From c0a7be3fd901925b5d348a4f9c2c388ff2eeea17 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 9 Jul 2026 22:22:03 +0100 Subject: [PATCH] Publish Aetheria asset manifest for Unity transport --- Aetheria.State.Daemon/Program.cs | 4 ++++ Aetheria.State.Verify/Program.cs | 6 +++++- .../Tests/DaemonRuntimeDocumentTests.cs | 20 +++++++++++++++++++ .../AetheriaEveUnitySceneProviderBridge.cs | 6 +----- .../Runtime/AetheriaClientState.cs | 4 ++++ .../AetheriaRuntimeDaemonTickRunner.cs | 8 ++++++++ .../Runtime/AetheriaRuntimeVerseClient.cs | 2 ++ 7 files changed, 44 insertions(+), 6 deletions(-) diff --git a/Aetheria.State.Daemon/Program.cs b/Aetheria.State.Daemon/Program.cs index a2ccccfb3..d1aec1f4d 100644 --- a/Aetheria.State.Daemon/Program.cs +++ b/Aetheria.State.Daemon/Program.cs @@ -1193,6 +1193,10 @@ static async Task PublishDaemonApiDocumentsAsync( await node.MutableDocument(AetheriaRuntimeVerseRecordKeys.DaemonCommandBoundary) .ReplaceAsync(result.CommandBoundary) .ConfigureAwait(false); + if (result.AssetManifest != null) + await node.MutableDocument(AetheriaRuntimeVerseRecordKeys.DaemonAssetManifest) + .ReplaceAsync(result.AssetManifest) + .ConfigureAwait(false); if (result.StarbridgeSessionSummary != null) await node.MutableDocument(AetheriaRuntimeVerseRecordKeys.StarbridgeSessionSummary) .ReplaceAsync(result.StarbridgeSessionSummary) diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 8c1e2eedc..22bd54c62 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -961,7 +961,9 @@ static void RequireSharedRuntimeSurfaceCommandsUseCultMeshTransport(string root) } var unityToolkitTransportHits = runtimeSources - .Where(pair => pair.Value.Contains("\"unity-uitoolkit\"", StringComparison.Ordinal)) + .Where(pair => + pair.Value.Contains("\"unity-uitoolkit\"", StringComparison.Ordinal) && + pair.Value.Contains("AetheriaRuntimeSurfaceCommandTemplate", StringComparison.Ordinal)) .Select(pair => pair.Key) .ToArray(); if (unityToolkitTransportHits.Length > 0) @@ -12083,6 +12085,7 @@ static void RequireDaemonVersePublication(string root) "node.MutableDocument(AetheriaRuntimeVerseRecordKeys.DaemonProviderAdvertisement)", "node.MutableDocument(AetheriaRuntimeVerseRecordKeys.DaemonHealth)", "node.MutableDocument(AetheriaRuntimeVerseRecordKeys.DaemonCommandBoundary)", + "node.MutableDocument(AetheriaRuntimeVerseRecordKeys.DaemonAssetManifest)", "node.MutableDocument(AetheriaRuntimeVerseRecordKeys.DaemonGameSurface)", "node.MutableDocument(AetheriaRuntimeVerseRecordKeys.DaemonGameTuiSurface)", "node.MutableDocument(AetheriaRuntimeVerseRecordKeys.DaemonEditorSurface)", @@ -12091,6 +12094,7 @@ static void RequireDaemonVersePublication(string root) ".ReplaceAsync(result.Frame)", ".ReplaceAsync(result.SoaView)", ".ReplaceAsync(result.Health)", + ".ReplaceAsync(result.AssetManifest)", ".ReplaceAsync(result.StarbridgeSessionSummary)", "InjectEveSurfaceSnapshotAsync(", "ReadEveSurfacePublicationAsync(", diff --git a/Assets/Scripts/Tests/DaemonRuntimeDocumentTests.cs b/Assets/Scripts/Tests/DaemonRuntimeDocumentTests.cs index a6347619f..96246001d 100644 --- a/Assets/Scripts/Tests/DaemonRuntimeDocumentTests.cs +++ b/Assets/Scripts/Tests/DaemonRuntimeDocumentTests.cs @@ -603,6 +603,12 @@ public class DaemonRuntimeDocumentTests command.Transport == "cultmesh")); Assert.IsFalse(editorSurface.Commands.Any(command => command.Command == "aetheria.daemon.commands.TransferCargoItem")); + var assetManifest = result.AssetManifest; + Assert.IsNotNull(assetManifest); + Assert.AreEqual(AetheriaRuntimeDaemonSchemas.AssetManifest, assetManifest.Schema); + Assert.IsTrue(assetManifest.Assets.Any(asset => + asset.Ref.AssetKey == "prefab.entity.ship" && + asset.Ref.Kind == AetheriaRuntimeAssetKinds.Prefab)); var editorTuiSurface = result.EditorTuiSurface; Assert.AreEqual("aetheria.daemon", editorTuiSurface.ProviderId); Assert.AreEqual("editor.daemon", editorTuiSurface.ProviderKind); @@ -617,6 +623,11 @@ public class DaemonRuntimeDocumentTests var unityGameTuiSurfaceState = ReadLatest(client.State.GameTuiSurface); var unityEditorSurfaceState = ReadLatest(client.State.EditorSurface); var unityEditorTuiSurfaceState = ReadLatest(client.State.EditorTuiSurface); + var unityAssetManifest = ReadLatest(client.State.AssetManifest); + Assert.AreEqual(AetheriaRuntimeDaemonSchemas.AssetManifest, unityAssetManifest.Schema); + Assert.IsTrue(unityAssetManifest.Assets.Any(asset => + asset.Ref.AssetKey == "prefab.entity.ship" && + asset.Ref.Kind == AetheriaRuntimeAssetKinds.Prefab)); var surfaceResolver = client.State.CreateEveSurfaceCultMeshStateRefResolver(); var unityGameSurface = AetheriaRuntimeSurfaceDocuments.ToEveSurfaceDocument( unityGameSurfaceState, @@ -5028,6 +5039,15 @@ public class DaemonRuntimeDocumentTests .ReplaceAsync(AetheriaRuntimeSurfaceDocuments.ToPortableSurface(result.EditorTuiSurface)) .GetAwaiter() .GetResult(); + if (result.AssetManifest != null) + { + client + .MutableDocument( + AetheriaRuntimeVerseRecordKeys.DaemonAssetManifest) + .ReplaceAsync(result.AssetManifest) + .GetAwaiter() + .GetResult(); + } client.FlushAsync() .GetAwaiter() .GetResult(); diff --git a/Packages/org.gamecult.aetheria.eve-runtime/Runtime/AetheriaEveUnitySceneProviderBridge.cs b/Packages/org.gamecult.aetheria.eve-runtime/Runtime/AetheriaEveUnitySceneProviderBridge.cs index df9d10771..b099e7f27 100644 --- a/Packages/org.gamecult.aetheria.eve-runtime/Runtime/AetheriaEveUnitySceneProviderBridge.cs +++ b/Packages/org.gamecult.aetheria.eve-runtime/Runtime/AetheriaEveUnitySceneProviderBridge.cs @@ -193,11 +193,7 @@ namespace GameCult.Aetheria.EveRuntime private EveUnityPlayableWorldAssetManifestDocument ReadAssetManifest(AetheriaClientState runtimeState) { - var catalog = runtimeState.Catalog.Latest(); - var manifest = AetheriaRuntimeAssets.ProjectManifest( - catalog, - runId: "", - baseUri: "cultmesh://aetheria.local/assets"); + var manifest = runtimeState.AssetManifest.Latest(); return ToUnityPlayableWorldAssetManifest(manifest); } diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaClientState.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaClientState.cs index 24763b041..48c556985 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaClientState.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaClientState.cs @@ -39,6 +39,7 @@ namespace GameCult.Aetheria.State.Verse CultMeshDocumentHandle providerAdvertisement, CultMeshDocumentHandle health, CultMeshDocumentHandle commandBoundary, + CultMeshDocumentHandle assetManifest, CultMeshDocumentHandle authorityPolicy, CultMeshDocumentHandle daemonFrame, CultMeshDocumentHandle daemonSoaView, @@ -76,6 +77,7 @@ namespace GameCult.Aetheria.State.Verse ProviderAdvertisement = providerAdvertisement ?? throw new ArgumentNullException(nameof(providerAdvertisement)); Health = health ?? throw new ArgumentNullException(nameof(health)); CommandBoundary = commandBoundary ?? throw new ArgumentNullException(nameof(commandBoundary)); + AssetManifest = assetManifest ?? throw new ArgumentNullException(nameof(assetManifest)); AuthorityPolicy = authorityPolicy ?? throw new ArgumentNullException(nameof(authorityPolicy)); DaemonFrame = daemonFrame ?? throw new ArgumentNullException(nameof(daemonFrame)); DaemonSoaView = daemonSoaView ?? throw new ArgumentNullException(nameof(daemonSoaView)); @@ -117,6 +119,8 @@ namespace GameCult.Aetheria.State.Verse public CultMeshDocumentHandle CommandBoundary { get; } + public CultMeshDocumentHandle AssetManifest { get; } + public CultMeshDocumentHandle AuthorityPolicy { get; } public CultMeshDocumentHandle DaemonFrame { get; } diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonTickRunner.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonTickRunner.cs index 91e9cdd26..d7d8742c9 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonTickRunner.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonTickRunner.cs @@ -47,6 +47,7 @@ namespace GameCult.Aetheria.State.Verse AetheriaRuntimeDaemonProviderAdvertisementDocument? providerAdvertisement = null, AetheriaRuntimeDaemonHealthDocument? health = null, AetheriaRuntimeDaemonCommandBoundaryDocument? commandBoundary = null, + AetheriaRuntimeAssetManifestDocument? assetManifest = null, AetheriaRuntimeStarbridgeSessionSummaryDocument? starbridgeSessionSummary = null, AetheriaRuntimeSurfaceDocument? gameSurface = null, AetheriaRuntimeSurfaceDocument? gameTuiSurface = null, @@ -63,6 +64,7 @@ namespace GameCult.Aetheria.State.Verse ProviderAdvertisement = providerAdvertisement; Health = health; CommandBoundary = commandBoundary; + AssetManifest = assetManifest; StarbridgeSessionSummary = starbridgeSessionSummary; GameSurface = gameSurface; GameTuiSurface = gameTuiSurface; @@ -77,6 +79,7 @@ namespace GameCult.Aetheria.State.Verse public AetheriaRuntimeDaemonProviderAdvertisementDocument? ProviderAdvertisement { get; } public AetheriaRuntimeDaemonHealthDocument? Health { get; } public AetheriaRuntimeDaemonCommandBoundaryDocument? CommandBoundary { get; } + public AetheriaRuntimeAssetManifestDocument? AssetManifest { get; } public AetheriaRuntimeStarbridgeSessionSummaryDocument? StarbridgeSessionSummary { get; } public AetheriaRuntimeSurfaceDocument? GameSurface { get; } public AetheriaRuntimeSurfaceDocument? GameTuiSurface { get; } @@ -210,6 +213,10 @@ namespace GameCult.Aetheria.State.Verse Array.Empty(), Array.Empty(), Array.Empty()); + var assetManifest = AetheriaRuntimeAssets.ProjectManifest( + catalog, + frame.Run?.RunId ?? "", + "cultmesh://aetheria.local/assets"); var starbridgeSummary = AetheriaRuntimeStarbridgeDocuments.SessionSummary( frame, options.StarbridgeScenario, @@ -238,6 +245,7 @@ namespace GameCult.Aetheria.State.Verse providerAdvertisement, health, commandBoundary, + assetManifest, starbridgeSummary, gameSurface, gameSurface, diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeVerseClient.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeVerseClient.cs index d739e412f..1f957dbd4 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeVerseClient.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeVerseClient.cs @@ -443,6 +443,8 @@ namespace GameCult.Aetheria.State.Verse AetheriaRuntimeVerseRecordKeys.DaemonHealth), Document( AetheriaRuntimeVerseRecordKeys.DaemonCommandBoundary), + Document( + AetheriaRuntimeVerseRecordKeys.DaemonAssetManifest), Document( AetheriaRuntimeVerseRecordKeys.VerseAuthorityPolicy), latestFrameDocument,