Use CultMesh Eve surface documents
This commit is contained in:
parent
b6d0d5fb4c
commit
bc8bd95d4b
22 changed files with 222 additions and 603 deletions
|
|
@ -611,7 +611,7 @@ static async Task InjectEveSurfaceSnapshotAsync(
|
|||
|
||||
var surfacePut = node.Database.Documents.CreateRawDocumentPutMessage(
|
||||
response.MessageId,
|
||||
new CultRecordHandle<EveSurfaceState>(new CultRecordKey(recordKey)),
|
||||
new CultRecordHandle<EveSurfaceDocument>(new CultRecordKey(recordKey)),
|
||||
surfaceState,
|
||||
new CultNetDocumentMessageOptions
|
||||
{
|
||||
|
|
@ -625,14 +625,14 @@ static async Task InjectEveSurfaceSnapshotAsync(
|
|||
.ToArray();
|
||||
}
|
||||
|
||||
static Task<EveSurfaceState?> ReadEveSurfacePublicationAsync(AetheriaStateNode node, string surfaceKind)
|
||||
static Task<EveSurfaceDocument?> ReadEveSurfacePublicationAsync(AetheriaStateNode node, string surfaceKind)
|
||||
{
|
||||
return surfaceKind switch
|
||||
{
|
||||
"game" => node.MutableDocument<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface).ReadAsync(),
|
||||
"game-tui" => node.MutableDocument<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface).ReadAsync(),
|
||||
"editor" => node.MutableDocument<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface).ReadAsync(),
|
||||
"editor-tui" => node.MutableDocument<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface).ReadAsync(),
|
||||
"game" => node.MutableDocument<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface).ReadAsync(),
|
||||
"game-tui" => node.MutableDocument<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface).ReadAsync(),
|
||||
"editor" => node.MutableDocument<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface).ReadAsync(),
|
||||
"editor-tui" => node.MutableDocument<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface).ReadAsync(),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(surfaceKind), surfaceKind, "Unknown Eve surface publication.")
|
||||
};
|
||||
}
|
||||
|
|
@ -779,20 +779,20 @@ static async Task PublishDaemonApiDocumentsAsync(
|
|||
.ReplaceAsync(result.StarbridgeSessionSummary)
|
||||
.ConfigureAwait(false);
|
||||
if (result.GameSurface != null)
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface)
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToEveSurfaceState(result.GameSurface))
|
||||
await node.MutableDocument<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface)
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToPortableSurface(result.GameSurface))
|
||||
.ConfigureAwait(false);
|
||||
if (result.GameTuiSurface != null)
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface)
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToEveSurfaceState(result.GameTuiSurface))
|
||||
await node.MutableDocument<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface)
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToPortableSurface(result.GameTuiSurface))
|
||||
.ConfigureAwait(false);
|
||||
if (result.EditorSurface != null)
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface)
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToEveSurfaceState(result.EditorSurface))
|
||||
await node.MutableDocument<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface)
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToPortableSurface(result.EditorSurface))
|
||||
.ConfigureAwait(false);
|
||||
if (result.EditorTuiSurface != null)
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface)
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToEveSurfaceState(result.EditorTuiSurface))
|
||||
await node.MutableDocument<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface)
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToPortableSurface(result.EditorTuiSurface))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
|
@ -865,10 +865,10 @@ static async Task PublishStateSurfacesAsync(
|
|||
? updatedAtUtc
|
||||
: playerSettings.LastUpdatedAtUtc;
|
||||
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaStateNode.OperationsSurfaceKey)
|
||||
await node.MutableDocument<EveSurfaceDocument>(AetheriaStateNode.OperationsSurfaceKey)
|
||||
.ReplaceAsync(AetheriaEveSurfaceDocuments.BuildOperationsSurface(eveStatus, verseHost, runtimeSession))
|
||||
.ConfigureAwait(false);
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaStateNode.PlayerSettingsSurfaceKey)
|
||||
await node.MutableDocument<EveSurfaceDocument>(AetheriaStateNode.PlayerSettingsSurfaceKey)
|
||||
.ReplaceAsync(AetheriaEveSurfaceDocuments.BuildPlayerSettingsSurface(playerSettings, playerSettingsUpdatedAt))
|
||||
.ConfigureAwait(false);
|
||||
await node.MutableDocument<EveProviderAdvertisementState>(AetheriaStateNode.ProviderAdvertisementSurfaceKey)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using Aetheria.State.Documents;
|
|||
using Aetheria.State.Migration;
|
||||
using GameCult.Caching;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Mesh;
|
||||
|
||||
var root = args.Length > 0 ? args[0] : Directory.GetCurrentDirectory();
|
||||
var stateDirectory = Path.Combine(Path.GetTempPath(), "aetheria-state-smoke", Guid.NewGuid().ToString("N"));
|
||||
|
|
@ -94,7 +95,7 @@ await using (var node = await AetheriaStateNode.OpenAsync(statePath, "aetheria-s
|
|||
|
||||
await node.FlushAsync();
|
||||
var runtimeCatalog = await node.RuntimeCatalog().LatestAsync().ConfigureAwait(false);
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaStateNode.CatalogSurfaceKey)
|
||||
await node.MutableDocument<EveSurfaceDocument>(AetheriaStateNode.CatalogSurfaceKey)
|
||||
.ReplaceAsync(AetheriaEveSurfaceDocuments.BuildCatalogSurface(runtimeCatalog, now));
|
||||
|
||||
var verseHostSettings = AetheriaVerseHostSettingsNormalizer.Normalize(new AetheriaVerseHostSettings
|
||||
|
|
@ -102,7 +103,7 @@ await using (var node = await AetheriaStateNode.OpenAsync(statePath, "aetheria-s
|
|||
LastUpdatedAtUtc = now
|
||||
});
|
||||
await node.MutableDocument<AetheriaVerseHostSettings>(AetheriaStateNode.VerseHostSettingsKey).ReplaceAsync(verseHostSettings);
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaStateNode.OperationsSurfaceKey)
|
||||
await node.MutableDocument<EveSurfaceDocument>(AetheriaStateNode.OperationsSurfaceKey)
|
||||
.ReplaceAsync(AetheriaEveSurfaceDocuments.BuildOperationsSurface(verseHostSettings: verseHostSettings));
|
||||
await node.MutableDocument<EveProviderAdvertisementState>(AetheriaStateNode.ProviderAdvertisementSurfaceKey)
|
||||
.ReplaceAsync(AetheriaEveSurfaceDocuments.BuildProviderAdvertisement(verseHostSettings, statePath, now));
|
||||
|
|
@ -172,8 +173,8 @@ await using (var node = await AetheriaStateNode.OpenAsync(statePath, "aetheria-s
|
|||
throw new InvalidOperationException("AetheriaClient control submission did not appear as a typed daemon state record.");
|
||||
}
|
||||
}
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface)
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToEveSurfaceState(daemonGameSurface));
|
||||
await node.MutableDocument<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface)
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToPortableSurface(daemonGameSurface));
|
||||
await node.MutableDocument<AetheriaRuntimeSession>(AetheriaStateNode.RuntimeSessionKey("smoke-runtime")).ReplaceAsync(new AetheriaRuntimeSession
|
||||
{
|
||||
RuntimeId = "smoke-runtime",
|
||||
|
|
@ -182,7 +183,7 @@ await using (var node = await AetheriaStateNode.OpenAsync(statePath, "aetheria-s
|
|||
LastSeenAtUtc = now,
|
||||
Status = "running"
|
||||
});
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaStateNode.OperationsSurfaceKey).ReplaceAsync(AetheriaEveSurfaceDocuments.BuildOperationsSurface(
|
||||
await node.MutableDocument<EveSurfaceDocument>(AetheriaStateNode.OperationsSurfaceKey).ReplaceAsync(AetheriaEveSurfaceDocuments.BuildOperationsSurface(
|
||||
verseHostSettings: verseHostSettings,
|
||||
runtimeSession: await node.MutableDocument<AetheriaRuntimeSession>(AetheriaStateNode.RuntimeSessionKey("smoke-runtime")).ReadAsync()));
|
||||
|
||||
|
|
@ -534,7 +535,7 @@ await using (var node = await AetheriaStateNode.OpenAsync(statePath, "aetheria-s
|
|||
ActionBarInputs = ["<Keyboard>/1", "<Mouse>/leftButton"]
|
||||
}
|
||||
});
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaStateNode.PlayerSettingsSurfaceKey)
|
||||
await node.MutableDocument<EveSurfaceDocument>(AetheriaStateNode.PlayerSettingsSurfaceKey)
|
||||
.ReplaceAsync(AetheriaEveSurfaceDocuments.BuildPlayerSettingsSurface(
|
||||
await node.MutableDocument<AetheriaPlayerSettings>(AetheriaStateNode.PlayerSettingsKey).ReadAsync(),
|
||||
now));
|
||||
|
|
@ -616,7 +617,7 @@ await using (var node = await AetheriaStateNode.OpenAsync(statePath, "aetheria-s
|
|||
Status = eveCommandReport.RejectedCommands > 0 ? "rejected" : "ok"
|
||||
};
|
||||
await node.MutableDocument<AetheriaEveCommandAcceptanceStatus>(AetheriaStateNode.EveCommandAcceptanceStatusKey).ReplaceAsync(eveCommandStatus);
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaStateNode.OperationsSurfaceKey).ReplaceAsync(AetheriaEveSurfaceDocuments.BuildOperationsSurface(
|
||||
await node.MutableDocument<EveSurfaceDocument>(AetheriaStateNode.OperationsSurfaceKey).ReplaceAsync(AetheriaEveSurfaceDocuments.BuildOperationsSurface(
|
||||
eveCommandStatus,
|
||||
verseHostSettings: await node.MutableDocument<AetheriaVerseHostSettings>(AetheriaStateNode.VerseHostSettingsKey).ReadAsync(),
|
||||
runtimeSession: await node.MutableDocument<AetheriaRuntimeSession>(AetheriaStateNode.RuntimeSessionKey("smoke-runtime")).ReadAsync()));
|
||||
|
|
@ -630,10 +631,10 @@ await using (var reopened = await AetheriaStateNode.OpenAsync(statePath, "aether
|
|||
var faction = await reopened.MutableDocument<AetheriaCorporation>(AetheriaCatalogKeys.CorporationFromLegacyId(factionLegacyId)).ReadAsync();
|
||||
var nameFile = await reopened.MutableDocument<AetheriaNameFile>(AetheriaCatalogKeys.NameFileFromLegacyId(nameFileLegacyId)).ReadAsync();
|
||||
var quarantine = await reopened.MutableDocument<AetheriaLegacyCatalogQuarantine>(AetheriaStateNode.LegacyCatalogQuarantineKey).ReadAsync();
|
||||
var catalogSurface = await reopened.MutableDocument<EveSurfaceState>(AetheriaStateNode.CatalogSurfaceKey).ReadAsync();
|
||||
var catalogSurface = await reopened.MutableDocument<EveSurfaceDocument>(AetheriaStateNode.CatalogSurfaceKey).ReadAsync();
|
||||
var eveCommandStatus = await reopened.MutableDocument<AetheriaEveCommandAcceptanceStatus>(AetheriaStateNode.EveCommandAcceptanceStatusKey).ReadAsync();
|
||||
var operationsSurface = await reopened.MutableDocument<EveSurfaceState>(AetheriaStateNode.OperationsSurfaceKey).ReadAsync();
|
||||
var playerSettingsSurface = await reopened.MutableDocument<EveSurfaceState>(AetheriaStateNode.PlayerSettingsSurfaceKey).ReadAsync();
|
||||
var operationsSurface = await reopened.MutableDocument<EveSurfaceDocument>(AetheriaStateNode.OperationsSurfaceKey).ReadAsync();
|
||||
var playerSettingsSurface = await reopened.MutableDocument<EveSurfaceDocument>(AetheriaStateNode.PlayerSettingsSurfaceKey).ReadAsync();
|
||||
var advertisement = await reopened.MutableDocument<EveProviderAdvertisementState>(AetheriaStateNode.ProviderAdvertisementSurfaceKey).ReadAsync();
|
||||
var daemonProvider = await reopened.MutableDocument<AetheriaRuntimeDaemonProviderAdvertisementDocument>(AetheriaRuntimeVerseRecordKeys.DaemonProviderAdvertisement)
|
||||
.ReadAsync();
|
||||
|
|
@ -643,7 +644,7 @@ await using (var reopened = await AetheriaStateNode.OpenAsync(statePath, "aether
|
|||
.ReadAsync();
|
||||
var daemonFrame = await reopened.MutableDocument<AetheriaRuntimeDaemonFrameDocument>(AetheriaRuntimeVerseRecordKeys.DaemonFrameLatest)
|
||||
.ReadAsync();
|
||||
var daemonGameSurface = await reopened.MutableDocument<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface)
|
||||
var daemonGameSurface = await reopened.MutableDocument<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface)
|
||||
.ReadAsync();
|
||||
var runtimeSession = await reopened.MutableDocument<AetheriaRuntimeSession>(AetheriaStateNode.RuntimeSessionKey("smoke-runtime")).ReadAsync();
|
||||
var playerSettings = await reopened.MutableDocument<AetheriaPlayerSettings>(AetheriaStateNode.PlayerSettingsKey).ReadAsync();
|
||||
|
|
@ -677,7 +678,7 @@ await using (var reopened = await AetheriaStateNode.OpenAsync(statePath, "aether
|
|||
throw new InvalidOperationException("Legacy catalog quarantine did not survive flush/reopen.");
|
||||
}
|
||||
|
||||
if (catalogSurface?.Schema != "gamecult.eve.surface.v1" ||
|
||||
if (catalogSurface == null ||
|
||||
catalogSurface.Surface.Id != AetheriaEveSurfaceDocuments.CatalogSurfaceId)
|
||||
{
|
||||
throw new InvalidOperationException("Eve catalog surface did not survive flush/reopen.");
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using Aetheria.State.Documents;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Mesh;
|
||||
|
||||
|
|
@ -26,7 +25,7 @@ public sealed class AetheriaRuntimeCatalogClient : IAsyncDisposable, IDisposable
|
|||
return _node.RuntimeCatalog().Latest();
|
||||
}
|
||||
|
||||
public EveSurfaceState? ReadCatalogSurface()
|
||||
public EveSurfaceDocument? ReadCatalogSurface()
|
||||
{
|
||||
return _node.CatalogSurface().Latest();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -516,15 +516,13 @@ if (string.IsNullOrWhiteSpace(corporationWithNames.GeonameFileKey) ||
|
|||
$"Typed catalog name-file-key lookup failed for corporation {corporationWithNames.Name}.");
|
||||
}
|
||||
|
||||
if (surface.Schema != "gamecult.eve.surface.v1" ||
|
||||
surface.Surface.Root.Kind != "surface" ||
|
||||
surface.Surface.Root.Children.Length == 0)
|
||||
if (surface.Surface.Root.Kind != "surface" ||
|
||||
surface.Surface.Root.Children.Count == 0)
|
||||
{
|
||||
throw new InvalidOperationException("Aetheria catalog Eve surface projection is not renderable.");
|
||||
}
|
||||
|
||||
if (publishedSurface.Schema != surface.Schema ||
|
||||
publishedSurface.Surface.Id != AetheriaEveSurfaceDocuments.CatalogSurfaceId ||
|
||||
if (publishedSurface.Surface.Id != AetheriaEveSurfaceDocuments.CatalogSurfaceId ||
|
||||
publishedSurface.Surface.Root.Kind != "surface")
|
||||
{
|
||||
throw new InvalidOperationException("Published Aetheria catalog Eve surface is not the expected typed surface.");
|
||||
|
|
@ -567,7 +565,7 @@ Console.WriteLine($"Thermal range/curve items: {importedThermalRangeItems}/{impo
|
|||
Console.WriteLine($"Action-bar icon items: {actionBarIconItems}");
|
||||
Console.WriteLine($"Docking bay max-size items: {dockingBayMaxSizeItems}/{dockingBayItems}");
|
||||
Console.WriteLine($"Typed catalog trade items: {tradeItems.Length}");
|
||||
Console.WriteLine($"Eve catalog surface: {surface.Surface.Id} ({surface.Surface.Root.Children.Length} root children)");
|
||||
Console.WriteLine($"Eve catalog surface: {surface.Surface.Id} ({surface.Surface.Root.Children.Count} root children)");
|
||||
Console.WriteLine($"Corporations: {corporations.Length}");
|
||||
Console.WriteLine($"Described/geoname-linked corporations: {describedCorporations}/{corporationNameLinks}");
|
||||
Console.WriteLine($"Corporation allegiance edges: {corporationAllegianceEdges}");
|
||||
|
|
@ -929,14 +927,14 @@ static void RequireSharedEvePackagesImportedFromEveRepo(string root)
|
|||
!runtimeCultCacheDocumentStore.Contains("routeDescription).ToBinding()", StringComparison.Ordinal) ||
|
||||
!runtimeSurfaceDocuments.Contains("CultMesh.OperationBindingRecord(", StringComparison.Ordinal) ||
|
||||
!runtimeSurfaceDocuments.Contains("command.SchemaId", StringComparison.Ordinal) ||
|
||||
!runtimeSurfaceDocuments.Contains("public static EveSurfaceState ToEveSurfaceState(AetheriaRuntimeSurfaceDocument document)", StringComparison.Ordinal) ||
|
||||
!runtimeSurfaceDocuments.Contains("global::Aetheria.State.Documents.EveSurfaceComponent ToEveSurfaceState(", StringComparison.Ordinal) ||
|
||||
!runtimeSurfaceDocuments.Contains("public static GameCult.Mesh.EveSurfaceDocument ToPortableSurface(AetheriaRuntimeSurfaceDocument document)", StringComparison.Ordinal) ||
|
||||
!runtimeSurfaceDocuments.Contains("new GameCult.Mesh.EveSurfaceCommandTemplate(command.Operation)", StringComparison.Ordinal) ||
|
||||
!surfaceCommandDocuments.Contains("CultMesh.OperationBindingRecord(", StringComparison.Ordinal) ||
|
||||
runtimeCultCacheDocumentStore.Contains("new CultMeshOperationBindingDescriptor(", StringComparison.Ordinal) ||
|
||||
runtimeSurfaceDocuments.Contains("new CultMeshOperationBindingDescriptor(", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Aetheria runtime surfaces reintroduced local operation binding flattening; surface command persistence belongs to CultMesh.OperationBindingRecord.");
|
||||
"Aetheria runtime surfaces reintroduced local operation binding flattening; portable surface command persistence belongs to CultMesh Eve documents.");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3372,7 +3370,7 @@ static void RequireEveRuntimeBootstrap(string root)
|
|||
".RuntimeState(stateBoot, \"unity-eve-surface-presenter\")",
|
||||
".EveSurfaceDocument(surfaceId)",
|
||||
"?.Reactive()",
|
||||
"AetheriaUnityRuntimeClientProvider.EveSurfaceStateRefResolver(",
|
||||
"AetheriaUnityRuntimeClientProvider.EveSurfaceCultMeshStateRefResolver(",
|
||||
"CultMeshReactiveDocument<global::Aetheria.State.Documents.EveSurfaceState>",
|
||||
"ResolveReactiveDaemonSurfaceState(",
|
||||
"DisposeReactiveSurfaceState()",
|
||||
|
|
@ -5516,7 +5514,7 @@ static void RequireInventoryCargoItemDetailsUseEveSurface(string root)
|
|||
!eveUnitySurfaceHost.Contains("prop.Key.EndsWith(\"Ref\", StringComparison.Ordinal)", StringComparison.Ordinal) ||
|
||||
!eveUnitySurfaceHost.Contains("CreateDefaultStateRefResolver()", StringComparison.Ordinal) ||
|
||||
!eveUnitySurfaceHost.Contains("AetheriaUnityRuntimeClientProvider", StringComparison.Ordinal) ||
|
||||
!eveUnitySurfaceHost.Contains("AetheriaUnityRuntimeClientProvider.EveSurfaceStateRefResolver(", StringComparison.Ordinal) ||
|
||||
!eveUnitySurfaceHost.Contains("AetheriaUnityRuntimeClientProvider.EveSurfaceCultMeshStateRefResolver(", StringComparison.Ordinal) ||
|
||||
!runtimeSurfaceDocuments.Contains("public static EveSurfaceDocument ResolveStateRefs(", StringComparison.Ordinal) ||
|
||||
!runtimeSurfaceDocuments.Contains("ResolvePropRefs(props, resolveStateRef)", StringComparison.Ordinal) ||
|
||||
!runtimeSurfaceDocuments.Contains("ResolvePropRef(props, AetheriaRuntimeSurfaceStateRefs.Source, \"value\", resolveStateRef)", StringComparison.Ordinal) ||
|
||||
|
|
@ -11526,10 +11524,10 @@ static void RequireDaemonVersePublication(string root)
|
|||
"public CultMeshMutableStatePointer<AetheriaRuntimeStarbridgeScenarioDocument> StarbridgeScenario()",
|
||||
"public CultMeshMutableStatePointer<AetheriaRuntimeStarbridgeSessionDocument> StarbridgeSession()",
|
||||
"public CultMeshMutableStatePointer<AetheriaRuntimeStarbridgeSessionSummaryDocument> StarbridgeSessionSummary()",
|
||||
"public CultMeshMutableStatePointer<EveSurfaceState> DaemonGameSurface()",
|
||||
"public CultMeshMutableStatePointer<EveSurfaceState> DaemonGameTuiSurface()",
|
||||
"public CultMeshMutableStatePointer<EveSurfaceState> DaemonEditorSurface()",
|
||||
"public CultMeshMutableStatePointer<EveSurfaceState> DaemonEditorTuiSurface()"
|
||||
"public CultMeshMutableStatePointer<EveSurfaceDocument> DaemonGameSurface()",
|
||||
"public CultMeshMutableStatePointer<EveSurfaceDocument> DaemonGameTuiSurface()",
|
||||
"public CultMeshMutableStatePointer<EveSurfaceDocument> DaemonEditorSurface()",
|
||||
"public CultMeshMutableStatePointer<EveSurfaceDocument> DaemonEditorTuiSurface()"
|
||||
};
|
||||
var survivingDaemonNodeSymbols = forbiddenDaemonNodeSymbols
|
||||
.Where(symbol => stateNode.Contains(symbol, StringComparison.Ordinal))
|
||||
|
|
@ -11548,11 +11546,11 @@ static void RequireDaemonVersePublication(string root)
|
|||
"Daemon Eve surface state lowering still lives in Aetheria.State projector chaff instead of the runtime surface documents.");
|
||||
}
|
||||
|
||||
if (!runtimeSurfaceDocuments.Contains("public static EveSurfaceState ToEveSurfaceState(AetheriaRuntimeSurfaceDocument document)", StringComparison.Ordinal) ||
|
||||
!runtimeSurfaceDocuments.Contains("EveCommandTemplate", StringComparison.Ordinal) ||
|
||||
!runtimeSurfaceDocuments.Contains("global::Aetheria.State.Documents.EveSurfaceComponent", StringComparison.Ordinal))
|
||||
if (!runtimeSurfaceDocuments.Contains("public static GameCult.Mesh.EveSurfaceDocument ToPortableSurface(AetheriaRuntimeSurfaceDocument document)", StringComparison.Ordinal) ||
|
||||
!runtimeSurfaceDocuments.Contains("GameCult.Mesh.EveSurfaceCommandTemplate", StringComparison.Ordinal) ||
|
||||
!runtimeSurfaceDocuments.Contains("GameCult.Mesh.EveSurfaceComponent", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException("Runtime surface documents no longer lowers daemon surfaces into registered Eve surface state.");
|
||||
throw new InvalidOperationException("Runtime surface documents no longer lower daemon surfaces into portable CultMesh Eve surface documents.");
|
||||
}
|
||||
|
||||
if (!daemonDocuments.Contains("AetheriaRuntimeDaemonCommandKinds", StringComparison.Ordinal))
|
||||
|
|
@ -12501,7 +12499,7 @@ static void RequireAetheriaRuntimeVerseClientContract(string root)
|
|||
var stateRefResolverPath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeStateRefResolver.cs");
|
||||
var docPath = Path.Combine(root, "docs", "aetheria-verse-client-contract.md");
|
||||
|
||||
var requiredFiles = new[] { clientPath, clientStatePath, surfaceStatePath, stateRefResolverPath, docPath };
|
||||
var requiredFiles = new[] { clientPath, clientStatePath, stateRefResolverPath, docPath };
|
||||
var missingFiles = requiredFiles
|
||||
.Where(path => !File.Exists(path))
|
||||
.Select(path => Path.GetRelativePath(root, path))
|
||||
|
|
@ -12515,14 +12513,19 @@ static void RequireAetheriaRuntimeVerseClientContract(string root)
|
|||
|
||||
var client = File.ReadAllText(clientPath);
|
||||
var clientState = File.ReadAllText(clientStatePath);
|
||||
var surfaceState = File.ReadAllText(surfaceStatePath);
|
||||
var stateRefResolver = File.ReadAllText(stateRefResolverPath);
|
||||
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.");
|
||||
"Aetheria-local EveSurfaceState must not own UI surface state; clients watch the shared CultMesh EveSurfaceDocument.");
|
||||
}
|
||||
|
||||
if (File.Exists(surfaceStatePath))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"AetheriaRuntimeEveSurfaceState.cs is legacy surface-state cruft; daemon UI surfaces must publish GameCult.Mesh.EveSurfaceDocument.");
|
||||
}
|
||||
|
||||
var requiredClientSymbols = new[]
|
||||
|
|
@ -12545,7 +12548,7 @@ static void RequireAetheriaRuntimeVerseClientContract(string root)
|
|||
"public static CultRecordKey StarbridgeSessionSummary",
|
||||
"new CultRecordKey(\"daemon:aetheria.starbridge.session.latest.v1\")",
|
||||
"Document<AetheriaRuntimeVerseAuthorityPolicyDocument>(",
|
||||
"typeof(EveSurfaceState)",
|
||||
"typeof(MeshEveSurfaceDocument)",
|
||||
"private AetheriaClientState? _aetheriaState",
|
||||
"private CultMeshReactiveDocument<AetheriaRuntimeDaemonFrameDocument>? _managedDaemonFrame",
|
||||
"private CultMeshReactiveDocument<AetheriaRuntimeCatalogSnapshot>? _managedCatalog",
|
||||
|
|
@ -12918,10 +12921,10 @@ static void RequireAetheriaRuntimeVerseClientContract(string root)
|
|||
"public async Task PutStarbridgeScenarioAsync(",
|
||||
"public async Task PutStarbridgeSessionAsync(",
|
||||
"public async Task PutStarbridgePlayerSeatAsync(",
|
||||
"public async Task<EveSurfaceState?> GetDaemonGameSurfaceAsync()",
|
||||
"public async Task<EveSurfaceState?> GetDaemonGameTuiSurfaceAsync()",
|
||||
"public async Task<EveSurfaceState?> GetDaemonEditorSurfaceAsync()",
|
||||
"public async Task<EveSurfaceState?> GetDaemonEditorTuiSurfaceAsync()",
|
||||
"public async Task<EveSurfaceDocument?> GetDaemonGameSurfaceAsync()",
|
||||
"public async Task<EveSurfaceDocument?> GetDaemonGameTuiSurfaceAsync()",
|
||||
"public async Task<EveSurfaceDocument?> GetDaemonEditorSurfaceAsync()",
|
||||
"public async Task<EveSurfaceDocument?> GetDaemonEditorTuiSurfaceAsync()",
|
||||
"public AetheriaRuntimeCatalogSnapshot OpenRuntimeCatalog()",
|
||||
"public async Task<AetheriaRuntimePlayerSettingsSnapshot?> GetPlayerSettingsAsync()",
|
||||
"public async Task<AetheriaRuntimeVerseHostSettingsSnapshot?> GetVerseHostSettingsAsync()",
|
||||
|
|
@ -12941,10 +12944,10 @@ static void RequireAetheriaRuntimeVerseClientContract(string root)
|
|||
"return Database.GetAsync<AetheriaRuntimeStarbridgeScenarioDocument>",
|
||||
"return Database.GetAsync<AetheriaRuntimeStarbridgeSessionDocument>",
|
||||
"return Database.GetAsync<AetheriaRuntimeStarbridgePlayerSeatDocument>",
|
||||
"return Database.GetAsync<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface);",
|
||||
"return Database.GetAsync<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface);",
|
||||
"return Database.GetAsync<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface);",
|
||||
"return Database.GetAsync<EveSurfaceState>(AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface);"
|
||||
"return Database.GetAsync<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface);",
|
||||
"return Database.GetAsync<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface);",
|
||||
"return Database.GetAsync<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface);",
|
||||
"return Database.GetAsync<EveSurfaceDocument>(AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface);"
|
||||
};
|
||||
var clientCompatibilityStoreBypassHits = forbiddenClientCompatibilityStoreBypasses
|
||||
.Where(symbol => client.Contains(symbol, StringComparison.Ordinal))
|
||||
|
|
@ -12969,27 +12972,6 @@ static void RequireAetheriaRuntimeVerseClientContract(string root)
|
|||
"AetheriaRuntimeVerseClient reintroduced a private document handle; use shared CultMeshMutableStatePointer<T> instead.");
|
||||
}
|
||||
|
||||
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 EveSurfaceStateBinding",
|
||||
"public EveSurfaceStateBinding[] StateBindings",
|
||||
"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));
|
||||
}
|
||||
|
||||
var deletedCommandPortPath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeCommandPort.cs");
|
||||
if (File.Exists(deletedCommandPortPath))
|
||||
{
|
||||
|
|
@ -13004,7 +12986,7 @@ static void RequireAetheriaRuntimeVerseClientContract(string root)
|
|||
"MutableDocument<T>(CultRecordKey)",
|
||||
"Unity",
|
||||
"Verse records",
|
||||
"EveSurfaceState",
|
||||
"EveSurfaceDocument",
|
||||
"same typed records"
|
||||
};
|
||||
var missingDocSymbols = requiredDocSymbols
|
||||
|
|
@ -16681,7 +16663,7 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root)
|
|||
runtimeCatalogStore.Contains("ReadFieldEveSurface", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Runtime catalog store still exposes Eve-surface parsing/projection helpers; surface access must flow through managed EveSurfaceState documents.");
|
||||
"Runtime catalog store still exposes Eve-surface parsing/projection helpers; surface access must flow through managed CultMesh EveSurfaceDocument handles.");
|
||||
}
|
||||
|
||||
if (!unityPackageProject.Contains("AetheriaRuntimeStateRefResolver.cs", StringComparison.Ordinal) ||
|
||||
|
|
@ -16896,8 +16878,8 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root)
|
|||
"public static AetheriaControl Control(string runtimeId = \"\")",
|
||||
"public static AetheriaUi Ui(string runtimeId = \"\")",
|
||||
"public static AetheriaUi Ui(",
|
||||
"public static CultMeshStateRefResolver EveSurfaceStateRefResolver(string runtimeId = \"\")",
|
||||
"public static CultMeshStateRefResolver EveSurfaceStateRefResolver(",
|
||||
"public static CultMeshStateRefResolver EveSurfaceCultMeshStateRefResolver(string runtimeId = \"\")",
|
||||
"public static CultMeshStateRefResolver EveSurfaceCultMeshStateRefResolver(",
|
||||
"private static readonly Dictionary<string, AetheriaClient> RuntimeClients",
|
||||
"RuntimeClients.TryGetValue(cacheKey, out var runtimeClient)",
|
||||
"RuntimeClients[cacheKey] = runtimeClient",
|
||||
|
|
@ -17540,8 +17522,8 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root)
|
|||
"Aetheria Eve surface presenter must grab the provider RuntimeState and read the daemon surface through AetheriaClientState reactive typed documents.");
|
||||
}
|
||||
|
||||
if (!eveSurfacePresenter.Contains("AetheriaUnityRuntimeClientProvider.EveSurfaceStateRefResolver(", StringComparison.Ordinal) ||
|
||||
!eveUnitySurfaceHost.Contains("AetheriaUnityRuntimeClientProvider.EveSurfaceStateRefResolver(", StringComparison.Ordinal))
|
||||
if (!eveSurfacePresenter.Contains("AetheriaUnityRuntimeClientProvider.EveSurfaceCultMeshStateRefResolver(", StringComparison.Ordinal) ||
|
||||
!eveUnitySurfaceHost.Contains("AetheriaUnityRuntimeClientProvider.EveSurfaceCultMeshStateRefResolver(", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Unity Eve surface lowering must resolve provider state refs through provider-native managed AetheriaClientState documents.");
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public static class AetheriaDocumentRegistry
|
|||
typeof(AetheriaRuntimeCommittedCommandFactDocument),
|
||||
typeof(AetheriaRuntimeEveCommandDocument),
|
||||
typeof(AetheriaRuntimeSurfaceDocument),
|
||||
typeof(EveSurfaceState),
|
||||
typeof(EveSurfaceDocument),
|
||||
typeof(EveProviderAdvertisementState)
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using Aetheria.State.Documents;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Mesh;
|
||||
|
||||
namespace Aetheria.State;
|
||||
|
||||
|
|
@ -51,7 +52,7 @@ public static class AetheriaEveCommandBridge
|
|||
{
|
||||
case AetheriaRuntimeEveCommandKind.CatalogRefresh:
|
||||
var catalog = await node.RuntimeCatalog().LatestAsync().ConfigureAwait(false);
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaStateNode.CatalogSurfaceKey)
|
||||
await node.MutableDocument<EveSurfaceDocument>(AetheriaStateNode.CatalogSurfaceKey)
|
||||
.ReplaceAsync(AetheriaEveSurfaceDocuments.BuildCatalogSurface(catalog, command.IssuedAtUtc))
|
||||
.ConfigureAwait(false);
|
||||
report.AcceptedCatalogRefreshes++;
|
||||
|
|
@ -61,7 +62,7 @@ public static class AetheriaEveCommandBridge
|
|||
EmptyEveCommandAcceptanceStatus(node.StatePath, command.IssuedAtUtc);
|
||||
var verseHostSettings = await node.MutableDocument<AetheriaVerseHostSettings>(AetheriaStateNode.VerseHostSettingsKey).ReadAsync().ConfigureAwait(false);
|
||||
var runtimeSession = await node.MutableDocument<AetheriaRuntimeSession>(AetheriaStateNode.RuntimeSessionKey(eveStatus.RuntimeId)).ReadAsync().ConfigureAwait(false);
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaStateNode.OperationsSurfaceKey)
|
||||
await node.MutableDocument<EveSurfaceDocument>(AetheriaStateNode.OperationsSurfaceKey)
|
||||
.ReplaceAsync(AetheriaEveSurfaceDocuments.BuildOperationsSurface(
|
||||
eveStatus,
|
||||
verseHostSettings,
|
||||
|
|
@ -188,7 +189,7 @@ public static class AetheriaEveCommandBridge
|
|||
.ConfigureAwait(false);
|
||||
}
|
||||
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaStateNode.PlayerSettingsSurfaceKey)
|
||||
await node.MutableDocument<EveSurfaceDocument>(AetheriaStateNode.PlayerSettingsSurfaceKey)
|
||||
.ReplaceAsync(AetheriaEveSurfaceDocuments.BuildPlayerSettingsSurface(settings, command.IssuedAtUtc))
|
||||
.ConfigureAwait(false);
|
||||
}
|
||||
|
|
@ -282,7 +283,7 @@ public static class AetheriaEveCommandBridge
|
|||
EmptyEveCommandAcceptanceStatus(node.StatePath, command.IssuedAtUtc);
|
||||
var runtimeSession = await node.MutableDocument<AetheriaRuntimeSession>(AetheriaStateNode.RuntimeSessionKey(eveStatus.RuntimeId)).ReadAsync().ConfigureAwait(false);
|
||||
|
||||
await node.MutableDocument<EveSurfaceState>(AetheriaStateNode.OperationsSurfaceKey)
|
||||
await node.MutableDocument<EveSurfaceDocument>(AetheriaStateNode.OperationsSurfaceKey)
|
||||
.ReplaceAsync(AetheriaEveSurfaceDocuments.BuildOperationsSurface(
|
||||
eveStatus,
|
||||
normalized,
|
||||
|
|
|
|||
|
|
@ -4,10 +4,9 @@ using System.Linq;
|
|||
using Aetheria.State.Documents;
|
||||
using GameCult.Aetheria.State.Verse;
|
||||
using GameCult.Mesh;
|
||||
using EveDocumentCommandTemplate = Aetheria.State.Documents.EveCommandTemplate;
|
||||
using EveDocumentStyleToken = Aetheria.State.Documents.EveStyleToken;
|
||||
using EveDocumentSurface = Aetheria.State.Documents.EveSurface;
|
||||
using EveDocumentSurfaceComponent = Aetheria.State.Documents.EveSurfaceComponent;
|
||||
using EveSurfaceComponent = GameCult.Mesh.EveSurfaceComponent;
|
||||
using EveSurfaceDocument = GameCult.Mesh.EveSurfaceDocument;
|
||||
using EveSurfaceTree = GameCult.Mesh.EveSurfaceTree;
|
||||
|
||||
namespace Aetheria.State;
|
||||
|
||||
|
|
@ -30,7 +29,7 @@ public static class AetheriaEveSurfaceDocuments
|
|||
private const string DaemonCommandBoundaryId = "aetheria.daemon.commands";
|
||||
private const string DaemonRecordTransport = "cultmesh-record";
|
||||
|
||||
public static EveSurfaceState BuildCatalogSurface(
|
||||
public static EveSurfaceDocument BuildCatalogSurface(
|
||||
AetheriaRuntimeCatalogSnapshot catalog,
|
||||
string updatedAtUtc,
|
||||
long version = 1)
|
||||
|
|
@ -60,17 +59,15 @@ public static class AetheriaEveSurfaceDocuments
|
|||
CultMeshLocalityKind.Automatic,
|
||||
"cultmesh")));
|
||||
|
||||
return new EveSurfaceState
|
||||
{
|
||||
ProviderId = ProviderId,
|
||||
ProviderKind = "game.runtime",
|
||||
Title = "Aetheria Catalog",
|
||||
Version = version,
|
||||
UpdatedAtUtc = updatedAtUtc,
|
||||
Surface = new EveDocumentSurface
|
||||
{
|
||||
Id = CatalogSurfaceId,
|
||||
Root = Node(
|
||||
return new EveSurfaceDocument(
|
||||
ProviderId,
|
||||
"game.runtime",
|
||||
"Aetheria Catalog",
|
||||
version,
|
||||
updatedAtUtc,
|
||||
new EveSurfaceTree(
|
||||
CatalogSurfaceId,
|
||||
Node(
|
||||
"aetheria.catalog.root",
|
||||
"surface",
|
||||
[],
|
||||
|
|
@ -93,24 +90,15 @@ public static class AetheriaEveSurfaceDocuments
|
|||
"aetheria.catalog.corporations",
|
||||
"card",
|
||||
[("title", "Corporations")],
|
||||
Node("aetheria.catalog.corporation.rows", "inspector.kv", [], corporations)))
|
||||
},
|
||||
Commands =
|
||||
[
|
||||
new EveDocumentCommandTemplate
|
||||
{
|
||||
Command = refreshCommand.OperationId,
|
||||
Label = refreshCommand.Label,
|
||||
Transport = refreshCommand.RouteDescription,
|
||||
SchemaId = refreshCommand.SchemaId,
|
||||
RouteKind = refreshCommand.RouteKind,
|
||||
RouteDescription = refreshCommand.RouteDescription
|
||||
}
|
||||
]
|
||||
};
|
||||
Node("aetheria.catalog.corporation.rows", "inspector.kv", [], corporations))),
|
||||
Array.Empty<EveSurfaceStyleToken>()),
|
||||
new[]
|
||||
{
|
||||
new EveSurfaceCommandTemplate(refreshCommand.ToBinding())
|
||||
});
|
||||
}
|
||||
|
||||
public static EveSurfaceState BuildOperationsSurface(
|
||||
public static EveSurfaceDocument BuildOperationsSurface(
|
||||
AetheriaEveCommandAcceptanceStatus? eveCommandStatus = null,
|
||||
AetheriaVerseHostSettings? verseHostSettings = null,
|
||||
AetheriaRuntimeSession? runtimeSession = null,
|
||||
|
|
@ -128,17 +116,15 @@ public static class AetheriaEveSurfaceDocuments
|
|||
routeHint: new CultMeshRouteHint(
|
||||
CultMeshLocalityKind.Automatic,
|
||||
"cultmesh")));
|
||||
return new EveSurfaceState
|
||||
{
|
||||
ProviderId = ProviderId,
|
||||
ProviderKind = "game.runtime",
|
||||
Title = "Aetheria Operations",
|
||||
Version = version,
|
||||
UpdatedAtUtc = updatedAtUtc,
|
||||
Surface = new EveDocumentSurface
|
||||
{
|
||||
Id = OperationsSurfaceId,
|
||||
Root = Node(
|
||||
return new EveSurfaceDocument(
|
||||
ProviderId,
|
||||
"game.runtime",
|
||||
"Aetheria Operations",
|
||||
version,
|
||||
updatedAtUtc,
|
||||
new EveSurfaceTree(
|
||||
OperationsSurfaceId,
|
||||
Node(
|
||||
"aetheria.operations.root",
|
||||
"surface",
|
||||
[],
|
||||
|
|
@ -188,24 +174,15 @@ public static class AetheriaEveSurfaceDocuments
|
|||
"runtimeSession.last",
|
||||
("runtime", runtimeSession?.RuntimeId ?? ""),
|
||||
("started", runtimeSession?.StartedAtUtc ?? ""),
|
||||
("lastSeen", runtimeSession?.LastSeenAtUtc ?? ""))))
|
||||
},
|
||||
Commands =
|
||||
[
|
||||
new EveDocumentCommandTemplate
|
||||
{
|
||||
Command = refreshCommand.OperationId,
|
||||
Label = refreshCommand.Label,
|
||||
Transport = refreshCommand.RouteDescription,
|
||||
SchemaId = refreshCommand.SchemaId,
|
||||
RouteKind = refreshCommand.RouteKind,
|
||||
RouteDescription = refreshCommand.RouteDescription
|
||||
}
|
||||
]
|
||||
};
|
||||
("lastSeen", runtimeSession?.LastSeenAtUtc ?? "")))),
|
||||
Array.Empty<EveSurfaceStyleToken>()),
|
||||
new[]
|
||||
{
|
||||
new EveSurfaceCommandTemplate(refreshCommand.ToBinding())
|
||||
});
|
||||
}
|
||||
|
||||
public static EveSurfaceState BuildPlayerSettingsSurface(
|
||||
public static EveSurfaceDocument BuildPlayerSettingsSurface(
|
||||
AetheriaPlayerSettings? settings,
|
||||
string updatedAtUtc,
|
||||
long version = 1)
|
||||
|
|
@ -228,41 +205,7 @@ public static class AetheriaEveSurfaceDocuments
|
|||
publishedAtUtc,
|
||||
version);
|
||||
|
||||
return new EveSurfaceState
|
||||
{
|
||||
ProviderId = surface.ProviderId,
|
||||
ProviderKind = surface.ProviderKind,
|
||||
Title = surface.Title,
|
||||
Version = surface.Version,
|
||||
UpdatedAtUtc = surface.UpdatedAtUtc,
|
||||
Surface = new EveDocumentSurface
|
||||
{
|
||||
Id = surface.Surface.Id,
|
||||
Root = ConvertComponent(surface.Surface.Root),
|
||||
Styles = surface.Surface.Styles
|
||||
.Select(style => new EveDocumentStyleToken
|
||||
{
|
||||
Name = style.Name,
|
||||
Value = style.Value
|
||||
})
|
||||
.ToArray()
|
||||
},
|
||||
Commands = surface.Commands
|
||||
.Select(command =>
|
||||
{
|
||||
var record = CultMesh.OperationBindingRecord(command.Operation);
|
||||
return new EveDocumentCommandTemplate
|
||||
{
|
||||
Command = record.OperationId,
|
||||
Label = record.Label,
|
||||
Transport = record.RouteDescription,
|
||||
SchemaId = record.SchemaId,
|
||||
RouteKind = record.RouteKind,
|
||||
RouteDescription = record.RouteDescription
|
||||
};
|
||||
})
|
||||
.ToArray()
|
||||
};
|
||||
return AetheriaRuntimeSurfaceDocuments.ToPortableSurface(surface);
|
||||
}
|
||||
|
||||
public static EveProviderAdvertisementState BuildProviderAdvertisement(
|
||||
|
|
@ -483,40 +426,27 @@ public static class AetheriaEveSurfaceDocuments
|
|||
return latest;
|
||||
}
|
||||
|
||||
private static EveDocumentSurfaceComponent Metric(string id, string label, string value)
|
||||
private static EveSurfaceComponent Metric(string id, string label, string value)
|
||||
{
|
||||
return Node(id, "metric", [("label", label), ("value", value)]);
|
||||
}
|
||||
|
||||
private static EveDocumentSurfaceComponent Row(string id, params (string Key, string Value)[] props)
|
||||
private static EveSurfaceComponent Row(string id, params (string Key, string Value)[] props)
|
||||
{
|
||||
return Node(id, "row", props);
|
||||
}
|
||||
|
||||
private static EveDocumentSurfaceComponent Node(
|
||||
private static EveSurfaceComponent Node(
|
||||
string id,
|
||||
string kind,
|
||||
(string Key, string Value)[] props,
|
||||
params EveDocumentSurfaceComponent[] children)
|
||||
params EveSurfaceComponent[] children)
|
||||
{
|
||||
return new EveDocumentSurfaceComponent
|
||||
{
|
||||
Id = id,
|
||||
Kind = kind,
|
||||
Props = props.ToDictionary(prop => prop.Key, prop => prop.Value),
|
||||
Children = children
|
||||
};
|
||||
}
|
||||
|
||||
private static EveDocumentSurfaceComponent ConvertComponent(AetheriaRuntimeSurfaceComponent component)
|
||||
{
|
||||
return new EveDocumentSurfaceComponent
|
||||
{
|
||||
Id = component.Id,
|
||||
Kind = component.Kind,
|
||||
Props = new Dictionary<string, string>(component.Props, StringComparer.Ordinal),
|
||||
Children = component.Children.Select(ConvertComponent).ToArray()
|
||||
};
|
||||
return new EveSurfaceComponent(
|
||||
id,
|
||||
kind,
|
||||
props.ToDictionary(prop => prop.Key, prop => prop.Value),
|
||||
children);
|
||||
}
|
||||
|
||||
private static string SafeId(string value)
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public sealed class AetheriaStateNode : IAsyncDisposable, IDisposable
|
|||
{
|
||||
private readonly CultMeshNode _node;
|
||||
private CultMeshDocumentHandle<AetheriaRuntimeCatalogSnapshot>? _runtimeCatalog;
|
||||
private CultMeshDocumentHandle<EveSurfaceState>? _catalogSurface;
|
||||
private CultMeshDocumentHandle<EveSurfaceDocument>? _catalogSurface;
|
||||
|
||||
private AetheriaStateNode(string statePath, string runtimeId, CultMeshNode node)
|
||||
{
|
||||
|
|
@ -123,7 +123,7 @@ public sealed class AetheriaStateNode : IAsyncDisposable, IDisposable
|
|||
routeHint: new CultMeshRouteHint(CultMeshLocalityKind.SharedMemory, "Aetheria typed catalog state"));
|
||||
}
|
||||
|
||||
public CultMeshDocumentHandle<EveSurfaceState> CatalogSurface()
|
||||
public CultMeshDocumentHandle<EveSurfaceDocument> CatalogSurface()
|
||||
{
|
||||
var catalog = RuntimeCatalog();
|
||||
return _catalogSurface ??= CultMesh.Document(
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ First implementation footholds now exist in CultLib:
|
|||
- `E:/Projects/CultLib/src/GameCult.Mesh/CultMeshPrimitives.cs` also exposes fluent operation/query context builders, with `CultMesh.OperationContextFor(...)` and `CultMesh.QueryContextFor(...)` entrypoints. Application code should read like a typed Verse call, not like manual transport setup.
|
||||
- `E:/Projects/CultLib/src/GameCult.Geometry/CultGeometryPrimitives.cs` defines shared `CultVec2`, `CultVec3`, `CultRect`, `CultCircle`, and `CultSphere` values for query and physics contracts.
|
||||
- `E:/Projects/CultLib/packages/cultmesh-ts/src/index.ts` now exposes TS `CultMeshVec2`, `CultMeshRect`, `CultMeshViewportRequest`, `CultMeshQuerySurface`, `CultMeshQueryContext`, `CultMeshOperationHandle`, `CultMeshOperationContext`, `CultMeshOperationPayload`, `CultMeshDocumentHandle`, `CultMeshDocumentCatalog`, `CultMeshCollectionHandle`, `CultMeshStatePointer`, `CultMeshStateBindingDescriptor`, `CultMeshOperationBindingDescriptor`, `CultMeshOperationInvocationDescriptor`, native slice descriptors, authority claims, route hints, fluent context builders, and handle helpers like `CultMesh.rectFromBounds(...)`, `CultMesh.viewportRequest(...)`, `CultMesh.query(...)`, `CultMesh.querySource(...)`, `CultMesh.operation(...)`, `CultMesh.document(...)`, `CultMesh.documents(...)`, `CultMesh.collection(...)`, `CultMesh.operationPayload(...)`, `CultMesh.statePointer(...)`, `CultMesh.stateBinding(...)`, `CultMesh.operationBinding(...)`, `CultMesh.operationInvocation(...)`, `CultMesh.nativeSliceView(...)`, `CultMesh.operationContextFor(...)`, and `CultMesh.queryContextFor(...)`.
|
||||
- `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimePlayerSettingsSurfaceBuilder.cs` and `E:/Projects/Eve/packages/org.gamecult.eve.surface/Runtime/EveSurfaceDocument.cs` now expose component `StateBindings` as `IReadOnlyList<CultMeshStateBindingDescriptor>`. Eve no longer owns a parallel live binding DTO, and Aetheria no longer keeps one in its live runtime surface model. Aetheria only keeps a MessagePack DTO at the persisted document boundary and converts to the shared CultMesh primitive before handing surfaces to renderers.
|
||||
- `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimePlayerSettingsSurfaceBuilder.cs` and `GameCult.Mesh.EveSurfaceDocument` now expose component state bindings as CultMesh-owned portable binding records. Eve no longer owns a parallel live binding DTO, and Aetheria no longer owns a parallel persisted Eve surface state. Aetheria can build runtime surface source data, then publishes the shared CultMesh surface document before renderers lower it.
|
||||
- `E:/Projects/Eve/packages/org.gamecult.eve.surface/Runtime/EveSurfaceDocument.cs` also exposes component `EmbeddedDocuments` as first-class CultUI slots. Aetheria runtime surfaces mirror that shape with `AetheriaRuntimeEmbeddedDocumentSlot`, so daemon-owned UI can compose nested synced surfaces such as inventory dropdowns without a Unity-only model, facade, or projector.
|
||||
- Aetheria and Eve live command templates now carry `CultMeshOperationBindingDescriptor`. Eve command requests carry `CultMeshOperationInvocationDescriptor` plus `CultMeshOperationPayload`, so renderer click/change events preserve operation id, schema, route hint, idempotency, and scalar field reads as shared CultMesh metadata. Legacy `command`, `label`, `transport`, and string payload fields remain compatibility projections and persisted DTO fields, but the live API no longer exposes raw command-string/dictionary constructors; controls point at typed CultMesh operations and renderers build requests from shared CultMesh primitives.
|
||||
- `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonOperationsClient.cs` is now a typed operation handle surface that returns `CultMeshOperationReceipt` from semantic verbs such as `SetMoveVector`, `SetTarget`, `DockNearest`, and inventory transfers. The lower-level daemon command envelope remains an internal transport wrapper, but public client code should receive shared CultMesh receipts, not Aetheria-specific command envelopes.
|
||||
|
|
@ -193,7 +193,7 @@ Current leak:
|
|||
|
||||
```csharp
|
||||
using var client = await AetheriaClient.OpenAsync(statePath, runtimeId);
|
||||
var resolver = client.State.CreateEveSurfaceStateRefResolver();
|
||||
var resolver = client.State.CreateEveSurfaceCultMeshStateRefResolver();
|
||||
var selected = resolver(surface.StateRef);
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ Current Eve surface state-ref resolution:
|
|||
|
||||
```csharp
|
||||
using var client = await AetheriaClient.OpenAsync(statePath, runtimeId);
|
||||
var resolver = client.State.CreateEveSurfaceStateRefResolver();
|
||||
var resolver = client.State.CreateEveSurfaceCultMeshStateRefResolver();
|
||||
var label = resolver("aetheria.daemon/frame/currentEntity/name");
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,6 @@ public static class AetheriaUnityEveRuntimeHooks
|
|||
AetheriaEveRuntimeUnityHooks.Ui =
|
||||
(stateBoot, runtimeId) => AetheriaUnityRuntimeClientProvider.Ui(stateBoot, runtimeId);
|
||||
AetheriaEveRuntimeUnityHooks.StateRefResolver =
|
||||
(stateBoot, runtimeId) => AetheriaUnityRuntimeClientProvider.EveSurfaceStateRefResolver(stateBoot, runtimeId);
|
||||
(stateBoot, runtimeId) => AetheriaUnityRuntimeClientProvider.EveSurfaceCultMeshStateRefResolver(stateBoot, runtimeId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,12 +129,12 @@ public static class AetheriaUnityRuntimeClientProvider
|
|||
return RuntimeClient(stateBoot, runtimeId).Ui;
|
||||
}
|
||||
|
||||
public static CultMeshStateRefResolver EveSurfaceStateRefResolver(string runtimeId = "")
|
||||
public static CultMeshStateRefResolver EveSurfaceCultMeshStateRefResolver(string runtimeId = "")
|
||||
{
|
||||
return RuntimeState(runtimeId).CreateEveSurfaceCultMeshStateRefResolver();
|
||||
}
|
||||
|
||||
public static CultMeshStateRefResolver EveSurfaceStateRefResolver(
|
||||
public static CultMeshStateRefResolver EveSurfaceCultMeshStateRefResolver(
|
||||
AetheriaRuntimeStateBootReport stateBoot,
|
||||
string runtimeId = "")
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ using EveSurfaceCommandRequest = GameCult.Eve.Surface.EveSurfaceCommandRequest;
|
|||
using EveSurfaceComponent = GameCult.Eve.Surface.EveSurfaceComponent;
|
||||
using EveSurfaceDocument = GameCult.Eve.Surface.EveSurfaceDocument;
|
||||
using EveSurfaceTree = GameCult.Eve.Surface.EveSurfaceTree;
|
||||
using MeshEveSurfaceDocument = GameCult.Mesh.EveSurfaceDocument;
|
||||
|
||||
public class DaemonRuntimeDocumentTests
|
||||
{
|
||||
|
|
@ -4350,27 +4351,27 @@ public class DaemonRuntimeDocumentTests
|
|||
.GetAwaiter()
|
||||
.GetResult();
|
||||
client
|
||||
.MutableDocument<Aetheria.State.Documents.EveSurfaceState>(
|
||||
.MutableDocument<MeshEveSurfaceDocument>(
|
||||
AetheriaRuntimeVerseRecordKeys.DaemonGameSurface)
|
||||
.ReplaceAsync(ToEveSurfaceState(result.GameSurface))
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToPortableSurface(result.GameSurface))
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
client
|
||||
.MutableDocument<Aetheria.State.Documents.EveSurfaceState>(
|
||||
.MutableDocument<MeshEveSurfaceDocument>(
|
||||
AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface)
|
||||
.ReplaceAsync(ToEveSurfaceState(result.GameTuiSurface))
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToPortableSurface(result.GameTuiSurface))
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
client
|
||||
.MutableDocument<Aetheria.State.Documents.EveSurfaceState>(
|
||||
.MutableDocument<MeshEveSurfaceDocument>(
|
||||
AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface)
|
||||
.ReplaceAsync(ToEveSurfaceState(result.EditorSurface))
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToPortableSurface(result.EditorSurface))
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
client
|
||||
.MutableDocument<Aetheria.State.Documents.EveSurfaceState>(
|
||||
.MutableDocument<MeshEveSurfaceDocument>(
|
||||
AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface)
|
||||
.ReplaceAsync(ToEveSurfaceState(result.EditorTuiSurface))
|
||||
.ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToPortableSurface(result.EditorTuiSurface))
|
||||
.GetAwaiter()
|
||||
.GetResult();
|
||||
client.FlushAsync()
|
||||
|
|
@ -4378,81 +4379,6 @@ public class DaemonRuntimeDocumentTests
|
|||
.GetResult();
|
||||
}
|
||||
|
||||
private static Aetheria.State.Documents.EveSurfaceState ToEveSurfaceState(
|
||||
AetheriaRuntimeSurfaceDocument document)
|
||||
{
|
||||
return new Aetheria.State.Documents.EveSurfaceState
|
||||
{
|
||||
ProviderId = document.ProviderId,
|
||||
ProviderKind = document.ProviderKind,
|
||||
Title = document.Title,
|
||||
Version = document.Version,
|
||||
UpdatedAtUtc = document.UpdatedAtUtc,
|
||||
Surface = ToEveSurface(document.Surface),
|
||||
Commands = document.Commands
|
||||
.Select(command =>
|
||||
{
|
||||
var record = CultMesh.OperationBindingRecord(command.Operation);
|
||||
return new Aetheria.State.Documents.EveCommandTemplate
|
||||
{
|
||||
Command = record.OperationId,
|
||||
Label = record.Label,
|
||||
Transport = record.RouteDescription,
|
||||
SchemaId = record.SchemaId,
|
||||
RouteKind = record.RouteKind,
|
||||
RouteDescription = record.RouteDescription
|
||||
};
|
||||
})
|
||||
.ToArray()
|
||||
};
|
||||
}
|
||||
|
||||
private static Aetheria.State.Documents.EveSurface ToEveSurface(AetheriaRuntimeSurfaceTree surface)
|
||||
{
|
||||
return new Aetheria.State.Documents.EveSurface
|
||||
{
|
||||
Id = surface.Id,
|
||||
Root = ToEveSurfaceComponent(surface.Root),
|
||||
Styles = surface.Styles
|
||||
.Select(style => new Aetheria.State.Documents.EveStyleToken
|
||||
{
|
||||
Name = style.Name,
|
||||
Value = style.Value
|
||||
})
|
||||
.ToArray()
|
||||
};
|
||||
}
|
||||
|
||||
private static Aetheria.State.Documents.EveSurfaceComponent ToEveSurfaceComponent(
|
||||
AetheriaRuntimeSurfaceComponent component)
|
||||
{
|
||||
var props = new Dictionary<string, string>(component.Props, StringComparer.Ordinal);
|
||||
AetheriaRuntimeSurfaceStateBindings.AddPointerProps(props, component.StateBindings);
|
||||
|
||||
return new Aetheria.State.Documents.EveSurfaceComponent
|
||||
{
|
||||
Id = component.Id,
|
||||
Kind = component.Kind,
|
||||
Props = props,
|
||||
Children = component.Children.Select(ToEveSurfaceComponent).ToArray(),
|
||||
StateBindings = component.StateBindings
|
||||
.Select(binding =>
|
||||
{
|
||||
var record = CultMesh.StateBindingRecord(binding);
|
||||
return new Aetheria.State.Documents.EveSurfaceStateBinding
|
||||
{
|
||||
TargetProp = record.TargetProp,
|
||||
PointerId = record.PointerId,
|
||||
SourceId = record.SourceId,
|
||||
SchemaId = record.SchemaId,
|
||||
RouteKind = record.RouteKind,
|
||||
RouteDescription = record.RouteDescription
|
||||
};
|
||||
})
|
||||
.ToArray()
|
||||
};
|
||||
}
|
||||
|
||||
private static void PublishVerseAuthorityPolicyThroughVerseClient(
|
||||
string statePath,
|
||||
AetheriaRuntimeVerseAuthorityPolicyDocument policy)
|
||||
|
|
|
|||
|
|
@ -93,7 +93,6 @@
|
|||
<Compile Include="Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeRtsViewportDocuments.cs" />
|
||||
<Compile Include="Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeZoneDetailsSurfaceBuilder.cs" />
|
||||
<Compile Include="Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeInventoryDropdownSurfaceDocuments.cs" />
|
||||
<Compile Include="Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeEveSurfaceState.cs" />
|
||||
<Compile Include="Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeDaemonSoaDocuments.cs" />
|
||||
<Compile Include="Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeVerseClient.cs" />
|
||||
<Compile Include="Packages\org.gamecult.aetheria.state\Runtime\AetheriaRuntimeCargoItemDetailsSurfaceBuilder.cs" />
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using GameCult.Eve.Surface;
|
|||
using GameCult.Mesh;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
using MeshEveSurfaceDocument = GameCult.Mesh.EveSurfaceDocument;
|
||||
|
||||
#nullable enable
|
||||
|
||||
|
|
@ -35,7 +36,7 @@ namespace GameCult.Aetheria.EveRuntime
|
|||
private string _mountedSurfaceId = "";
|
||||
private long _mountedSurfaceVersion = -1;
|
||||
private string _mountedSurfaceUpdatedAtUtc = "";
|
||||
private CultMeshReactiveDocument<global::Aetheria.State.Documents.EveSurfaceState>? _reactiveSurfaceState;
|
||||
private CultMeshReactiveDocument<MeshEveSurfaceDocument>? _reactiveSurfaceState;
|
||||
private string _reactiveSurfaceStatePath = "";
|
||||
private string _reactiveSurfaceId = "";
|
||||
private static readonly AetheriaEveUnitySurfaceChrome RootOnlyChrome = new AetheriaEveUnitySurfaceChrome
|
||||
|
|
@ -140,14 +141,14 @@ namespace GameCult.Aetheria.EveRuntime
|
|||
"unity-eve-surface-presenter"));
|
||||
}
|
||||
|
||||
private global::Aetheria.State.Documents.EveSurfaceState? ReadDaemonSurfaceState(
|
||||
private MeshEveSurfaceDocument? ReadDaemonSurfaceState(
|
||||
AetheriaRuntimeStateBootReport stateBoot)
|
||||
{
|
||||
var reactive = ResolveReactiveDaemonSurfaceState(stateBoot);
|
||||
return reactive?.Current;
|
||||
}
|
||||
|
||||
private CultMeshReactiveDocument<global::Aetheria.State.Documents.EveSurfaceState>? ResolveReactiveDaemonSurfaceState(
|
||||
private CultMeshReactiveDocument<MeshEveSurfaceDocument>? ResolveReactiveDaemonSurfaceState(
|
||||
AetheriaRuntimeStateBootReport stateBoot)
|
||||
{
|
||||
if (_reactiveSurfaceState != null &&
|
||||
|
|
@ -168,7 +169,7 @@ namespace GameCult.Aetheria.EveRuntime
|
|||
return _reactiveSurfaceState;
|
||||
}
|
||||
|
||||
private CultMeshReactiveDocument<global::Aetheria.State.Documents.EveSurfaceState>? CreateReactiveDaemonSurfaceState(
|
||||
private CultMeshReactiveDocument<MeshEveSurfaceDocument>? CreateReactiveDaemonSurfaceState(
|
||||
AetheriaRuntimeStateBootReport stateBoot)
|
||||
{
|
||||
try
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using GameCult.Mesh;
|
||||
using MessagePack;
|
||||
using MeshEveSurfaceDocument = GameCult.Mesh.EveSurfaceDocument;
|
||||
|
||||
#nullable enable
|
||||
|
||||
|
|
@ -41,10 +42,10 @@ namespace GameCult.Aetheria.State.Verse
|
|||
CultMeshDocumentHandle<AetheriaRuntimeVerseAuthorityPolicyDocument> authorityPolicy,
|
||||
CultMeshDocumentHandle<AetheriaRuntimeDaemonFrameDocument> daemonFrame,
|
||||
CultMeshDocumentHandle<AetheriaRuntimeDaemonSoaViewDocument> daemonSoaView,
|
||||
CultMeshDocumentHandle<global::Aetheria.State.Documents.EveSurfaceState> gameSurface,
|
||||
CultMeshDocumentHandle<global::Aetheria.State.Documents.EveSurfaceState> gameTuiSurface,
|
||||
CultMeshDocumentHandle<global::Aetheria.State.Documents.EveSurfaceState> editorSurface,
|
||||
CultMeshDocumentHandle<global::Aetheria.State.Documents.EveSurfaceState> editorTuiSurface,
|
||||
CultMeshDocumentHandle<MeshEveSurfaceDocument> gameSurface,
|
||||
CultMeshDocumentHandle<MeshEveSurfaceDocument> gameTuiSurface,
|
||||
CultMeshDocumentHandle<MeshEveSurfaceDocument> editorSurface,
|
||||
CultMeshDocumentHandle<MeshEveSurfaceDocument> editorTuiSurface,
|
||||
CultMeshDocumentHandle<AetheriaRuntimeCatalogSnapshot> catalog,
|
||||
CultMeshDocumentHandle<AetheriaRuntimeLoadoutTemplatesDocument> loadoutTemplates,
|
||||
CultMeshDocumentHandle<AetheriaRuntimePlayerSettingsDocument> playerSettings,
|
||||
|
|
@ -126,13 +127,13 @@ namespace GameCult.Aetheria.State.Verse
|
|||
|
||||
public CultMeshDocumentHandle<AetheriaRuntimeLoadoutTemplatesDocument> LoadoutTemplates { get; }
|
||||
|
||||
public CultMeshDocumentHandle<global::Aetheria.State.Documents.EveSurfaceState> GameSurface { get; }
|
||||
public CultMeshDocumentHandle<MeshEveSurfaceDocument> GameSurface { get; }
|
||||
|
||||
public CultMeshDocumentHandle<global::Aetheria.State.Documents.EveSurfaceState> GameTuiSurface { get; }
|
||||
public CultMeshDocumentHandle<MeshEveSurfaceDocument> GameTuiSurface { get; }
|
||||
|
||||
public CultMeshDocumentHandle<global::Aetheria.State.Documents.EveSurfaceState> EditorSurface { get; }
|
||||
public CultMeshDocumentHandle<MeshEveSurfaceDocument> EditorSurface { get; }
|
||||
|
||||
public CultMeshDocumentHandle<global::Aetheria.State.Documents.EveSurfaceState> EditorTuiSurface { get; }
|
||||
public CultMeshDocumentHandle<MeshEveSurfaceDocument> EditorTuiSurface { get; }
|
||||
|
||||
public CultMeshDocumentHandle<AetheriaRuntimePlayerSettingsDocument> PlayerSettings { get; }
|
||||
|
||||
|
|
@ -190,7 +191,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
return false;
|
||||
}
|
||||
|
||||
public CultMeshDocumentHandle<global::Aetheria.State.Documents.EveSurfaceState>? EveSurfaceDocument(
|
||||
public CultMeshDocumentHandle<MeshEveSurfaceDocument>? EveSurfaceDocument(
|
||||
string? surfaceId)
|
||||
{
|
||||
if (!TryResolveEveSurface(surfaceId, out var surface))
|
||||
|
|
|
|||
|
|
@ -1,128 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using GameCult.Caching;
|
||||
using MessagePack;
|
||||
|
||||
namespace Aetheria.State.Documents;
|
||||
|
||||
[CultDocument("gamecult.eve.surface", "gamecult.eve.surface.v1")]
|
||||
[MessagePackObject]
|
||||
public sealed class EveSurfaceState
|
||||
{
|
||||
[Key(0)]
|
||||
public string Type { get; set; } = "surface-state";
|
||||
|
||||
[Key(1)]
|
||||
[CultIndex("schema")]
|
||||
public string Schema { get; set; } = "gamecult.eve.surface.v1";
|
||||
|
||||
[Key(2)]
|
||||
[CultIndex("providerId")]
|
||||
public string ProviderId { get; set; } = "";
|
||||
|
||||
[Key(3)]
|
||||
[CultIndex("providerKind")]
|
||||
public string ProviderKind { get; set; } = "";
|
||||
|
||||
[Key(4)]
|
||||
[CultName]
|
||||
public string Title { get; set; } = "";
|
||||
|
||||
[Key(5)]
|
||||
public long Version { get; set; }
|
||||
|
||||
[Key(6)]
|
||||
public string UpdatedAtUtc { get; set; } = "";
|
||||
|
||||
[Key(7)]
|
||||
public EveSurface Surface { get; set; } = new();
|
||||
|
||||
[Key(8)]
|
||||
public EveCommandTemplate[] Commands { get; set; } = Array.Empty<EveCommandTemplate>();
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class EveSurface
|
||||
{
|
||||
[Key(0)]
|
||||
public string Id { get; set; } = "";
|
||||
|
||||
[Key(1)]
|
||||
public EveSurfaceComponent Root { get; set; } = new();
|
||||
|
||||
[Key(2)]
|
||||
public EveStyleToken[] Styles { get; set; } = Array.Empty<EveStyleToken>();
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class EveSurfaceComponent
|
||||
{
|
||||
[Key(0)]
|
||||
public string Id { get; set; } = "";
|
||||
|
||||
[Key(1)]
|
||||
public string Kind { get; set; } = "";
|
||||
|
||||
[Key(2)]
|
||||
public Dictionary<string, string> Props { get; set; } = new();
|
||||
|
||||
[Key(3)]
|
||||
public EveSurfaceComponent[] Children { get; set; } = Array.Empty<EveSurfaceComponent>();
|
||||
|
||||
[Key(4)]
|
||||
public EveSurfaceStateBinding[] StateBindings { get; set; } = Array.Empty<EveSurfaceStateBinding>();
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class EveSurfaceStateBinding
|
||||
{
|
||||
[Key(0)]
|
||||
public string TargetProp { get; set; } = "value";
|
||||
|
||||
[Key(1)]
|
||||
public string PointerId { get; set; } = "";
|
||||
|
||||
[Key(2)]
|
||||
public string SourceId { get; set; } = "";
|
||||
|
||||
[Key(3)]
|
||||
public string SchemaId { get; set; } = "";
|
||||
|
||||
[Key(4)]
|
||||
public string RouteKind { get; set; } = "";
|
||||
|
||||
[Key(5)]
|
||||
public string RouteDescription { get; set; } = "";
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class EveStyleToken
|
||||
{
|
||||
[Key(0)]
|
||||
public string Name { get; set; } = "";
|
||||
|
||||
[Key(1)]
|
||||
public string Value { get; set; } = "";
|
||||
}
|
||||
|
||||
[MessagePackObject]
|
||||
public sealed class EveCommandTemplate
|
||||
{
|
||||
[Key(0)]
|
||||
public string Command { get; set; } = "";
|
||||
|
||||
[Key(1)]
|
||||
public string Label { get; set; } = "";
|
||||
|
||||
[Key(2)]
|
||||
public string Transport { get; set; } = "cultmesh";
|
||||
|
||||
[Key(3)]
|
||||
public string SchemaId { get; set; } = "";
|
||||
|
||||
[Key(4)]
|
||||
public string RouteKind { get; set; } = "";
|
||||
|
||||
[Key(5)]
|
||||
public string RouteDescription { get; set; } = "";
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d01c44e962c7c114aa065999ab666f92
|
||||
|
|
@ -4,7 +4,6 @@ using System.Linq;
|
|||
using GameCult.Caching;
|
||||
using GameCult.Mesh;
|
||||
using MessagePack;
|
||||
using EveSurfaceState = global::Aetheria.State.Documents.EveSurfaceState;
|
||||
using EveUiCommandTemplate = GameCult.Eve.Surface.EveCommandTemplate;
|
||||
using EveUiEmbeddedDocumentSlot = GameCult.Eve.Surface.EveEmbeddedDocumentSlot;
|
||||
using EveUiStyleToken = GameCult.Eve.Surface.EveStyleToken;
|
||||
|
|
@ -239,34 +238,25 @@ namespace GameCult.Aetheria.State.Verse
|
|||
|
||||
public static class AetheriaRuntimeSurfaceDocuments
|
||||
{
|
||||
public static EveSurfaceState ToEveSurfaceState(AetheriaRuntimeSurfaceDocument document)
|
||||
public static GameCult.Mesh.EveSurfaceDocument ToPortableSurface(AetheriaRuntimeSurfaceDocument document)
|
||||
{
|
||||
if (document == null) throw new ArgumentNullException(nameof(document));
|
||||
|
||||
return new EveSurfaceState
|
||||
{
|
||||
ProviderId = document.ProviderId,
|
||||
ProviderKind = document.ProviderKind,
|
||||
Title = document.Title,
|
||||
Version = document.Version,
|
||||
UpdatedAtUtc = document.UpdatedAtUtc,
|
||||
Surface = ToEveSurfaceState(document.Surface),
|
||||
Commands = document.Commands
|
||||
.Select(command =>
|
||||
{
|
||||
var record = CultMesh.OperationBindingRecord(command.Operation);
|
||||
return new global::Aetheria.State.Documents.EveCommandTemplate
|
||||
{
|
||||
Command = record.OperationId,
|
||||
Label = record.Label,
|
||||
Transport = record.RouteDescription,
|
||||
SchemaId = record.SchemaId,
|
||||
RouteKind = record.RouteKind,
|
||||
RouteDescription = record.RouteDescription
|
||||
};
|
||||
})
|
||||
.ToArray()
|
||||
};
|
||||
return new GameCult.Mesh.EveSurfaceDocument(
|
||||
document.ProviderId,
|
||||
document.ProviderKind,
|
||||
document.Title,
|
||||
document.Version,
|
||||
document.UpdatedAtUtc,
|
||||
new GameCult.Mesh.EveSurfaceTree(
|
||||
document.Surface.Id,
|
||||
ToPortableComponent(document.Surface.Root),
|
||||
document.Surface.Styles
|
||||
.Select(style => new GameCult.Mesh.EveSurfaceStyleToken(style.Name, style.Value))
|
||||
.ToArray()),
|
||||
document.Commands
|
||||
.Select(command => new GameCult.Mesh.EveSurfaceCommandTemplate(command.Operation))
|
||||
.ToArray());
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeSurfaceDocument FromPortableSurface(GameCult.Mesh.EveSurfaceDocument document)
|
||||
|
|
@ -296,37 +286,18 @@ namespace GameCult.Aetheria.State.Verse
|
|||
return ToEveSurfaceDocument(document, null);
|
||||
}
|
||||
|
||||
public static EveUiSurfaceDocument ToEveSurfaceDocument(EveSurfaceState state)
|
||||
public static EveUiSurfaceDocument ToEveSurfaceDocument(GameCult.Mesh.EveSurfaceDocument document)
|
||||
{
|
||||
return ToEveSurfaceDocument(state, null);
|
||||
return ToEveSurfaceDocument(document, null);
|
||||
}
|
||||
|
||||
public static EveUiSurfaceDocument ToEveSurfaceDocument(
|
||||
EveSurfaceState state,
|
||||
GameCult.Mesh.EveSurfaceDocument document,
|
||||
CultMeshStateRefResolver? stateRefResolver)
|
||||
{
|
||||
if (state == null) throw new ArgumentNullException(nameof(state));
|
||||
if (document == null) throw new ArgumentNullException(nameof(document));
|
||||
|
||||
var surface = new EveUiSurfaceDocument(
|
||||
state.Type,
|
||||
state.Schema,
|
||||
state.ProviderId,
|
||||
state.ProviderKind,
|
||||
state.Title,
|
||||
state.Version,
|
||||
state.UpdatedAtUtc,
|
||||
new EveUiSurfaceTree(
|
||||
state.Surface.Id,
|
||||
ToEveSurfaceComponent(state.Surface.Root),
|
||||
state.Surface.Styles
|
||||
.Select(style => new EveUiStyleToken(style.Name, style.Value))
|
||||
.ToArray()),
|
||||
state.Commands
|
||||
.Select(command => new EveUiCommandTemplate(
|
||||
ToCultMeshOperationBinding(command)))
|
||||
.ToArray());
|
||||
|
||||
return ResolveStateRefs(surface, stateRefResolver);
|
||||
return ToEveSurfaceDocument(FromPortableSurface(document), stateRefResolver);
|
||||
}
|
||||
|
||||
public static EveUiSurfaceDocument ToEveSurfaceDocument(
|
||||
|
|
@ -415,70 +386,6 @@ namespace GameCult.Aetheria.State.Verse
|
|||
component.EmbeddedDocuments.Select(ToEveEmbeddedDocumentSlot).ToArray());
|
||||
}
|
||||
|
||||
private static global::Aetheria.State.Documents.EveSurface ToEveSurfaceState(
|
||||
AetheriaRuntimeSurfaceTree surface)
|
||||
{
|
||||
return new global::Aetheria.State.Documents.EveSurface
|
||||
{
|
||||
Id = surface.Id,
|
||||
Root = ToEveSurfaceState(surface.Root),
|
||||
Styles = surface.Styles
|
||||
.Select(style => new global::Aetheria.State.Documents.EveStyleToken
|
||||
{
|
||||
Name = style.Name,
|
||||
Value = style.Value
|
||||
})
|
||||
.ToArray()
|
||||
};
|
||||
}
|
||||
|
||||
private static global::Aetheria.State.Documents.EveSurfaceComponent ToEveSurfaceState(
|
||||
AetheriaRuntimeSurfaceComponent component)
|
||||
{
|
||||
var props = new Dictionary<string, string>(component.Props, StringComparer.Ordinal);
|
||||
AetheriaRuntimeSurfaceStateBindings.AddPointerProps(props, component.StateBindings);
|
||||
|
||||
return new global::Aetheria.State.Documents.EveSurfaceComponent
|
||||
{
|
||||
Id = component.Id,
|
||||
Kind = component.Kind,
|
||||
Props = props,
|
||||
Children = component.Children.Select(ToEveSurfaceState).ToArray(),
|
||||
StateBindings = component.StateBindings
|
||||
.Select(binding =>
|
||||
{
|
||||
var record = CultMesh.StateBindingRecord(binding);
|
||||
return new global::Aetheria.State.Documents.EveSurfaceStateBinding
|
||||
{
|
||||
TargetProp = record.TargetProp,
|
||||
PointerId = record.PointerId,
|
||||
SourceId = record.SourceId,
|
||||
SchemaId = record.SchemaId,
|
||||
RouteKind = record.RouteKind,
|
||||
RouteDescription = record.RouteDescription
|
||||
};
|
||||
})
|
||||
.ToArray()
|
||||
};
|
||||
}
|
||||
|
||||
private static EveUiSurfaceComponent ToEveSurfaceComponent(global::Aetheria.State.Documents.EveSurfaceComponent component)
|
||||
{
|
||||
var props = new Dictionary<string, string>(component.Props, StringComparer.Ordinal);
|
||||
var stateBindings = (component.StateBindings ?? Array.Empty<global::Aetheria.State.Documents.EveSurfaceStateBinding>())
|
||||
.Select(ToRuntimeStateBinding)
|
||||
.ToArray();
|
||||
AetheriaRuntimeSurfaceStateBindings.AddPointerProps(
|
||||
props,
|
||||
stateBindings);
|
||||
return new EveUiSurfaceComponent(
|
||||
component.Id,
|
||||
component.Kind,
|
||||
props,
|
||||
component.Children.Select(ToEveSurfaceComponent).ToArray(),
|
||||
stateBindings.Select(ToCultMeshStateBinding).ToArray());
|
||||
}
|
||||
|
||||
private static EveUiEmbeddedDocumentSlot ToEveEmbeddedDocumentSlot(AetheriaRuntimeEmbeddedDocumentSlot slot)
|
||||
{
|
||||
return new EveUiEmbeddedDocumentSlot(
|
||||
|
|
@ -495,35 +402,6 @@ namespace GameCult.Aetheria.State.Verse
|
|||
return binding;
|
||||
}
|
||||
|
||||
private static CultMeshStateBindingDescriptor ToRuntimeStateBinding(
|
||||
global::Aetheria.State.Documents.EveSurfaceStateBinding binding)
|
||||
{
|
||||
return CultMesh.StateBindingRecord(
|
||||
binding.TargetProp,
|
||||
binding.PointerId,
|
||||
binding.SourceId,
|
||||
binding.SchemaId,
|
||||
binding.RouteKind,
|
||||
binding.RouteDescription).ToBinding();
|
||||
}
|
||||
|
||||
private static CultMeshOperationBindingDescriptor ToCultMeshOperationBinding(
|
||||
global::Aetheria.State.Documents.EveCommandTemplate command)
|
||||
{
|
||||
var routeKind = string.IsNullOrWhiteSpace(command.RouteKind)
|
||||
? nameof(CultMeshLocalityKind.Automatic)
|
||||
: command.RouteKind;
|
||||
var routeDescription = string.IsNullOrWhiteSpace(command.RouteDescription)
|
||||
? command.Transport
|
||||
: command.RouteDescription;
|
||||
return CultMesh.OperationBindingRecord(
|
||||
command.Command,
|
||||
command.Label,
|
||||
command.SchemaId,
|
||||
routeKind,
|
||||
routeDescription).ToBinding();
|
||||
}
|
||||
|
||||
private static EveUiSurfaceComponent ResolveStateRefs(
|
||||
EveUiSurfaceComponent component,
|
||||
Func<string, string> resolveStateRef)
|
||||
|
|
@ -603,6 +481,35 @@ namespace GameCult.Aetheria.State.Verse
|
|||
return new CultMeshRouteRecord(route.Kind, route.Description).ToRoute(CultMeshRouteHint.Automatic);
|
||||
}
|
||||
|
||||
private static GameCult.Mesh.EveSurfaceComponent ToPortableComponent(AetheriaRuntimeSurfaceComponent component)
|
||||
{
|
||||
var props = new Dictionary<string, string>(component.Props, StringComparer.Ordinal);
|
||||
AetheriaRuntimeSurfaceStateBindings.AddPointerProps(props, component.StateBindings);
|
||||
|
||||
return new GameCult.Mesh.EveSurfaceComponent(
|
||||
component.Id,
|
||||
component.Kind,
|
||||
props,
|
||||
component.Children.Select(ToPortableComponent).ToArray(),
|
||||
component.StateBindings
|
||||
.Select(GameCult.Mesh.EveSurfaceStateBinding.FromDescriptor)
|
||||
.ToArray(),
|
||||
component.EmbeddedDocuments
|
||||
.Select(ToPortableEmbeddedDocumentSlot)
|
||||
.ToArray());
|
||||
}
|
||||
|
||||
private static GameCult.Mesh.EveEmbeddedDocumentSlot ToPortableEmbeddedDocumentSlot(
|
||||
AetheriaRuntimeEmbeddedDocumentSlot slot)
|
||||
{
|
||||
return new GameCult.Mesh.EveEmbeddedDocumentSlot(
|
||||
slot.SlotId,
|
||||
slot.DocumentId,
|
||||
slot.SchemaId,
|
||||
slot.PresentationKind,
|
||||
GameCult.Mesh.EveSurfaceRouteHint.FromRoute(slot.RouteHint));
|
||||
}
|
||||
|
||||
private static void ResolvePropRefs(
|
||||
Dictionary<string, string> props,
|
||||
Func<string, string> resolveStateRef)
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ using System.Globalization;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Aetheria.State.Documents;
|
||||
using GameCult.Caching;
|
||||
using GameCult.Caching.MessagePack;
|
||||
using GameCult.Eve.Surface;
|
||||
using GameCult.Mesh;
|
||||
using GameCult.Networking;
|
||||
using R3;
|
||||
using EveUiCommandRequest = GameCult.Eve.Surface.EveSurfaceCommandRequest;
|
||||
using MeshEveSurfaceDocument = GameCult.Mesh.EveSurfaceDocument;
|
||||
|
||||
#nullable enable
|
||||
|
||||
|
|
@ -122,9 +122,9 @@ namespace GameCult.Aetheria.State.Verse
|
|||
typeof(AetheriaRuntimePlayerSettingsDocument),
|
||||
typeof(AetheriaRuntimeVerseHostSettingsDocument),
|
||||
typeof(AetheriaRuntimeSurfaceDocument),
|
||||
typeof(MeshEveSurfaceDocument),
|
||||
typeof(AetheriaRuntimeDaemonCommandDocument),
|
||||
typeof(AetheriaRuntimeEveCommandDocument),
|
||||
typeof(EveSurfaceState)
|
||||
typeof(AetheriaRuntimeEveCommandDocument)
|
||||
};
|
||||
|
||||
public static CultDocumentRegistry CreateCultCacheRegistry()
|
||||
|
|
@ -324,7 +324,7 @@ namespace GameCult.Aetheria.State.Verse
|
|||
}
|
||||
|
||||
internal Task<AetheriaRuntimeEveCommandEnvelope> SubmitKnownSurfaceCommandAsync(
|
||||
EveSurfaceCommandRequest request,
|
||||
EveUiCommandRequest request,
|
||||
string clientId,
|
||||
bool flush = true)
|
||||
{
|
||||
|
|
@ -421,13 +421,13 @@ namespace GameCult.Aetheria.State.Verse
|
|||
latestFrameDocument,
|
||||
Document<AetheriaRuntimeDaemonSoaViewDocument>(
|
||||
AetheriaRuntimeVerseRecordKeys.DaemonSoaViewLatest),
|
||||
Document<EveSurfaceState>(
|
||||
Document<MeshEveSurfaceDocument>(
|
||||
AetheriaRuntimeVerseRecordKeys.DaemonGameSurface),
|
||||
Document<EveSurfaceState>(
|
||||
Document<MeshEveSurfaceDocument>(
|
||||
AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface),
|
||||
Document<EveSurfaceState>(
|
||||
Document<MeshEveSurfaceDocument>(
|
||||
AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface),
|
||||
Document<EveSurfaceState>(
|
||||
Document<MeshEveSurfaceDocument>(
|
||||
AetheriaRuntimeVerseRecordKeys.DaemonEditorTuiSurface),
|
||||
catalogDocument,
|
||||
loadoutTemplatesDocument,
|
||||
|
|
|
|||
|
|
@ -134,9 +134,11 @@ The daemon already publishes game and editor Eve surface records at these keys:
|
|||
|
||||
`AetheriaRuntimeVerseRecordKeys` exposes those keys and
|
||||
`AetheriaRuntimeVerseClient` exposes typed reads, mutable state pointers, and
|
||||
`WatchRecord<EveSurfaceState>(CultRecordKey)` 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.
|
||||
`WatchRecord<GameCult.Mesh.EveSurfaceDocument>(CultRecordKey)` subscriptions for
|
||||
all four. The Eve surface document contract lives in CultMesh because Eve is the
|
||||
UI projection language, not an Aetheria persisted-state owner. A Unity client,
|
||||
terminal client, daemon inspector, or later non-C# runtime binding lowers the
|
||||
same published `GameCult.Mesh.EveSurfaceDocument`. 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.
|
||||
|
|
|
|||
|
|
@ -314,7 +314,7 @@ Work on Unity thin-client migration:
|
|||
|
||||
Work on Eve/CultUI surfaces:
|
||||
|
||||
- `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeEveSurfaceState.cs`
|
||||
- `GameCult.Mesh.EveSurfaceDocument` for daemon-published CultUI/Eve surfaces
|
||||
- `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeSurfaceDocuments.cs`
|
||||
- `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeEveCommandClient.cs`
|
||||
- `Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntime*SurfaceBuilder.cs`
|
||||
|
|
|
|||
Loading…
Reference in a new issue