From a5595d009b6ec313356332a176cb14ab94d52099 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 10 Jul 2026 08:20:25 +0100 Subject: [PATCH] Graduate Unity package authority to EveUnity --- packages/org.gamecult.eve.surface/README.md | 29 - .../org.gamecult.eve.surface/README.md.meta | 7 - .../org.gamecult.eve.surface/Runtime.meta | 8 - .../Runtime/EveAssetCatalogDocument.cs | 144 --- .../Runtime/EveAssetCatalogDocument.cs.meta | 2 - .../Runtime/EveProviderDocuments.cs | 261 ------ .../Runtime/EveProviderDocuments.cs.meta | 2 - .../Runtime/EveSurfaceBuilder.cs | 874 ------------------ .../Runtime/EveSurfaceBuilder.cs.meta | 2 - .../Runtime/EveSurfaceDocument.cs | 414 --------- .../Runtime/EveSurfaceDocument.cs.meta | 2 - .../Runtime/GameCult.Eve.Surface.asmdef | 20 - .../Runtime/GameCult.Eve.Surface.asmdef.meta | 7 - .../org.gamecult.eve.surface/package.json | 18 - .../package.json.meta | 7 - .../README.md | 150 --- .../README.md.meta | 7 - .../Runtime.meta | 8 - .../Runtime/EveUiToolkitSurfaceLowerer.cs | 547 ----------- .../EveUiToolkitSurfaceLowerer.cs.meta | 2 - .../Runtime/EveUiToolkitSurfaceOptions.cs | 36 - .../EveUiToolkitSurfaceOptions.cs.meta | 2 - .../GameCult.Eve.UnityUIToolkit.asmdef | 16 - .../GameCult.Eve.UnityUIToolkit.asmdef.meta | 7 - .../IEveUiToolkitPluginProjectionAdapter.cs | 23 - ...veUiToolkitPluginProjectionAdapter.cs.meta | 2 - .../NornGraphUiToolkitProjectionAdapter.cs | 85 -- ...ornGraphUiToolkitProjectionAdapter.cs.meta | 2 - ...aiVisualNovelUiToolkitProjectionAdapter.cs | 205 ---- ...ualNovelUiToolkitProjectionAdapter.cs.meta | 2 - .../TeXMathUiToolkitProjectionAdapter.cs | 69 -- .../TeXMathUiToolkitProjectionAdapter.cs.meta | 2 - .../Tests.meta | 8 - .../Tests/Editor.meta | 8 - .../Editor/EveUiToolkitSurfaceLowererTests.cs | 144 --- .../EveUiToolkitSurfaceLowererTests.cs.meta | 2 - .../GameCult.Eve.UnityUIToolkit.Tests.asmdef | 27 - ...eCult.Eve.UnityUIToolkit.Tests.asmdef.meta | 7 - .../eve-runtime-capability.json | 252 ----- .../eve-runtime-capability.json.meta | 2 - .../eveunity-split-handoff.json | 97 -- .../eveunity-split-handoff.json.meta | 7 - .../package.json | 18 - .../package.json.meta | 7 - ...un-aetheria-conformance-consumer-smoke.ps1 | 4 - scripts/run-conformance-consumer-smoke.ps1 | 2 +- .../run-eveunity-capture-contract-smoke.ps1 | 99 -- scripts/run-eveunity-lifecycle-smoke.ps1 | 289 ------ scripts/run-eveunity-owner-smoke.ps1 | 44 + .../run-eveunity-release-artifact-smoke.ps1 | 107 --- .../run-eveunity-release-contract-smoke.ps1 | 106 --- scripts/run-eveunity-split-handoff-smoke.ps1 | 139 --- .../run-eveunity-uitoolkit-capture-smoke.ps1 | 80 -- scripts/run-parity-harness.ps1 | 13 +- ...ntime-owner-conformance-consumer-smoke.ps1 | 21 +- ...plit-target-conformance-consumer-smoke.ps1 | 9 +- tools/parity/parity-manifest.json | 110 +-- 57 files changed, 90 insertions(+), 4474 deletions(-) delete mode 100644 packages/org.gamecult.eve.surface/README.md delete mode 100644 packages/org.gamecult.eve.surface/README.md.meta delete mode 100644 packages/org.gamecult.eve.surface/Runtime.meta delete mode 100644 packages/org.gamecult.eve.surface/Runtime/EveAssetCatalogDocument.cs delete mode 100644 packages/org.gamecult.eve.surface/Runtime/EveAssetCatalogDocument.cs.meta delete mode 100644 packages/org.gamecult.eve.surface/Runtime/EveProviderDocuments.cs delete mode 100644 packages/org.gamecult.eve.surface/Runtime/EveProviderDocuments.cs.meta delete mode 100644 packages/org.gamecult.eve.surface/Runtime/EveSurfaceBuilder.cs delete mode 100644 packages/org.gamecult.eve.surface/Runtime/EveSurfaceBuilder.cs.meta delete mode 100644 packages/org.gamecult.eve.surface/Runtime/EveSurfaceDocument.cs delete mode 100644 packages/org.gamecult.eve.surface/Runtime/EveSurfaceDocument.cs.meta delete mode 100644 packages/org.gamecult.eve.surface/Runtime/GameCult.Eve.Surface.asmdef delete mode 100644 packages/org.gamecult.eve.surface/Runtime/GameCult.Eve.Surface.asmdef.meta delete mode 100644 packages/org.gamecult.eve.surface/package.json delete mode 100644 packages/org.gamecult.eve.surface/package.json.meta delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/README.md delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/README.md.meta delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Runtime.meta delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceLowerer.cs delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceLowerer.cs.meta delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceOptions.cs delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceOptions.cs.meta delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Runtime/GameCult.Eve.UnityUIToolkit.asmdef delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Runtime/GameCult.Eve.UnityUIToolkit.asmdef.meta delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Runtime/IEveUiToolkitPluginProjectionAdapter.cs delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Runtime/IEveUiToolkitPluginProjectionAdapter.cs.meta delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Runtime/NornGraphUiToolkitProjectionAdapter.cs delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Runtime/NornGraphUiToolkitProjectionAdapter.cs.meta delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Runtime/SaiVisualNovelUiToolkitProjectionAdapter.cs delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Runtime/SaiVisualNovelUiToolkitProjectionAdapter.cs.meta delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Runtime/TeXMathUiToolkitProjectionAdapter.cs delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Runtime/TeXMathUiToolkitProjectionAdapter.cs.meta delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Tests.meta delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor.meta delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs.meta delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef.meta delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json.meta delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/eveunity-split-handoff.json delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/eveunity-split-handoff.json.meta delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/package.json delete mode 100644 packages/org.gamecult.eve.unity-uitoolkit/package.json.meta delete mode 100644 scripts/run-eveunity-capture-contract-smoke.ps1 delete mode 100644 scripts/run-eveunity-lifecycle-smoke.ps1 create mode 100644 scripts/run-eveunity-owner-smoke.ps1 delete mode 100644 scripts/run-eveunity-release-artifact-smoke.ps1 delete mode 100644 scripts/run-eveunity-release-contract-smoke.ps1 delete mode 100644 scripts/run-eveunity-split-handoff-smoke.ps1 delete mode 100644 scripts/run-eveunity-uitoolkit-capture-smoke.ps1 diff --git a/packages/org.gamecult.eve.surface/README.md b/packages/org.gamecult.eve.surface/README.md deleted file mode 100644 index eb65c17..0000000 --- a/packages/org.gamecult.eve.surface/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# Eve Surface Contract - -This package defines the retained CultUI surface document that every Eve -runtime lowers. - -Components own normal child layout through `Children`, live CultMesh value -bindings through `StateBindings`, and nested synced document regions through -`EmbeddedDocuments`. An embedded document slot names the child document id, -schema, presentation kind, and route hint; renderers resolve that child through -CultMesh instead of rebuilding it with runtime-local projection code. - -See `../../docs/surface-contract-v1.md` for the full contract and -`../../web/fixtures/cultui-embedded-surface.json` for the parity fixture. -Runtime discovery and required feature coverage live in -`../../tools/parity/parity-manifest.json`; active GUI runtimes must list -`embeddedDocuments` as a supported feature and require the `embedded-surface` -fixture. - -Verification entrypoints: - -- Browser/TypeScript: `node --test web\eve-dsl.test.mjs` -- Semantic runtime matrix: `powershell -ExecutionPolicy Bypass -File .\scripts\run-parity-harness.ps1` -- Flutter GUI contract, when Flutter is installed: `flutter test --plain-name embedded_surface_fixture_contract` -- Rust/CultMesh document sync: run `cargo test rust_preserves_cultui_embedded_surface_slots_through_typed_document_sync` from `E:/Projects/CultLib/packages/cultnet-rs` - -The parity manifest is the discovery source for web, Flutter desktop/Linux/Android, -iOS/UIKit, Android/Kotlin, Unity UI Toolkit, and Rust contract coverage. Do not -add a new renderer claim without adding its nested-surface fixture requirement -there. diff --git a/packages/org.gamecult.eve.surface/README.md.meta b/packages/org.gamecult.eve.surface/README.md.meta deleted file mode 100644 index 4bc751a..0000000 --- a/packages/org.gamecult.eve.surface/README.md.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: fe5aa27636bead047b2aecb14fdc59f2 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/packages/org.gamecult.eve.surface/Runtime.meta b/packages/org.gamecult.eve.surface/Runtime.meta deleted file mode 100644 index f150917..0000000 --- a/packages/org.gamecult.eve.surface/Runtime.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 2164f6fea1216214d895e7dc99c46ecf -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/packages/org.gamecult.eve.surface/Runtime/EveAssetCatalogDocument.cs b/packages/org.gamecult.eve.surface/Runtime/EveAssetCatalogDocument.cs deleted file mode 100644 index eba3b44..0000000 --- a/packages/org.gamecult.eve.surface/Runtime/EveAssetCatalogDocument.cs +++ /dev/null @@ -1,144 +0,0 @@ -using System; -using System.Collections.Generic; -using GameCult.Caching; -using MessagePack; - -#nullable enable - -namespace GameCult.Eve.Surface -{ - [CultDocument("gamecult.eve.asset_catalog", SchemaId)] - [MessagePackObject] - public sealed class EveAssetCatalogDocument - { - public const string SchemaId = "gamecult.eve.asset_catalog.v1"; - - [SerializationConstructor] - public EveAssetCatalogDocument( - string schema, - string providerId, - string catalogId, - long version, - string updatedAtUtc, - EveAssetCatalogEntry[] assets) - { - Schema = string.IsNullOrWhiteSpace(schema) ? SchemaId : schema; - ProviderId = providerId ?? ""; - CatalogId = catalogId ?? ""; - Version = version; - UpdatedAtUtc = updatedAtUtc ?? ""; - Assets = assets ?? Array.Empty(); - } - - public EveAssetCatalogDocument( - string providerId, - string catalogId, - long version, - string updatedAtUtc, - EveAssetCatalogEntry[] assets) - : this(SchemaId, providerId, catalogId, version, updatedAtUtc, assets) - { - } - - [Key(0)] public string Schema { get; } - [Key(1)] public string ProviderId { get; } - [Key(2)] public string CatalogId { get; } - [Key(3)] public long Version { get; } - [Key(4)] public string UpdatedAtUtc { get; } - [Key(5)] public EveAssetCatalogEntry[] Assets { get; } - } - - [MessagePackObject] - public sealed class EveAssetCatalogEntry - { - [SerializationConstructor] - public EveAssetCatalogEntry( - string assetRef, - string assetKind, - EveAssetVariant[] variants, - Dictionary metadata) - { - AssetRef = assetRef ?? ""; - AssetKind = assetKind ?? ""; - Variants = variants ?? Array.Empty(); - Metadata = metadata == null - ? new Dictionary(StringComparer.Ordinal) - : new Dictionary(metadata, StringComparer.Ordinal); - } - - public EveAssetCatalogEntry( - string assetRef, - string assetKind, - EveAssetVariant[] variants, - IReadOnlyDictionary? metadata = null) - : this( - assetRef, - assetKind, - variants, - metadata == null ? new Dictionary() : new Dictionary(metadata)) - { - } - - [Key(0)] public string AssetRef { get; } - [Key(1)] public string AssetKind { get; } - [Key(2)] public EveAssetVariant[] Variants { get; } - [Key(3)] public Dictionary Metadata { get; } - } - - [MessagePackObject] - public sealed class EveAssetVariant - { - [SerializationConstructor] - public EveAssetVariant( - string runtimeId, - string platform, - string format, - string uri, - string contentHash, - long sizeBytes, - string assetKey, - Dictionary metadata) - { - RuntimeId = runtimeId ?? ""; - Platform = platform ?? ""; - Format = format ?? ""; - Uri = uri ?? ""; - ContentHash = contentHash ?? ""; - SizeBytes = sizeBytes; - AssetKey = assetKey ?? ""; - Metadata = metadata == null - ? new Dictionary(StringComparer.Ordinal) - : new Dictionary(metadata, StringComparer.Ordinal); - } - - public EveAssetVariant( - string runtimeId, - string platform, - string format, - string uri, - string contentHash, - long sizeBytes, - string assetKey, - IReadOnlyDictionary? metadata = null) - : this( - runtimeId, - platform, - format, - uri, - contentHash, - sizeBytes, - assetKey, - metadata == null ? new Dictionary() : new Dictionary(metadata)) - { - } - - [Key(0)] public string RuntimeId { get; } - [Key(1)] public string Platform { get; } - [Key(2)] public string Format { get; } - [Key(3)] public string Uri { get; } - [Key(4)] public string ContentHash { get; } - [Key(5)] public long SizeBytes { get; } - [Key(6)] public string AssetKey { get; } - [Key(7)] public Dictionary Metadata { get; } - } -} diff --git a/packages/org.gamecult.eve.surface/Runtime/EveAssetCatalogDocument.cs.meta b/packages/org.gamecult.eve.surface/Runtime/EveAssetCatalogDocument.cs.meta deleted file mode 100644 index 0af6487..0000000 --- a/packages/org.gamecult.eve.surface/Runtime/EveAssetCatalogDocument.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 8f53654f7c98d894588127ba001f11b4 \ No newline at end of file diff --git a/packages/org.gamecult.eve.surface/Runtime/EveProviderDocuments.cs b/packages/org.gamecult.eve.surface/Runtime/EveProviderDocuments.cs deleted file mode 100644 index e9bb1da..0000000 --- a/packages/org.gamecult.eve.surface/Runtime/EveProviderDocuments.cs +++ /dev/null @@ -1,261 +0,0 @@ -using System; -using System.Collections.Generic; -using GameCult.Caching; -using MessagePack; - -#nullable enable - -namespace GameCult.Eve.Surface -{ - [CultDocument("gamecult.eve.provider_advertisement", SchemaId)] - [MessagePackObject] - public sealed class EveProviderAdvertisementDocument - { - public const string SchemaId = "gamecult.eve.provider_advertisement.v1"; - - public EveProviderAdvertisementDocument( - string providerId, - string serviceId, - string verseId, - string title, - string kind, - string cultMeshAddress, - string updatedAtUtc, - EveProviderFreshness freshness, - IReadOnlyList schemas, - IReadOnlyList witnesses, - IReadOnlyList surfaces, - IReadOnlyList commands) - : this(SchemaId, providerId, serviceId, verseId, title, kind, cultMeshAddress, updatedAtUtc, freshness, schemas, witnesses, surfaces, commands) - { - } - - [SerializationConstructor] - public EveProviderAdvertisementDocument( - string schema, - string providerId, - string serviceId, - string verseId, - string title, - string kind, - string cultMeshAddress, - string updatedAtUtc, - EveProviderFreshness freshness, - IReadOnlyList schemas, - IReadOnlyList witnesses, - IReadOnlyList surfaces, - IReadOnlyList commands) - { - Schema = string.IsNullOrWhiteSpace(schema) ? SchemaId : schema; - ProviderId = providerId ?? ""; - ServiceId = serviceId ?? ""; - VerseId = verseId ?? ""; - Title = title ?? ""; - Kind = kind ?? ""; - CultMeshAddress = cultMeshAddress ?? ""; - UpdatedAtUtc = updatedAtUtc ?? ""; - Freshness = freshness ?? new EveProviderFreshness("unknown", "", 0); - Schemas = schemas ?? Array.Empty(); - Witnesses = witnesses ?? Array.Empty(); - Surfaces = surfaces ?? Array.Empty(); - Commands = commands ?? Array.Empty(); - } - - [Key(0)] public string Schema { get; } - [Key(1)] public string ProviderId { get; } - [Key(2)] public string ServiceId { get; } - [Key(3)] public string VerseId { get; } - [Key(4)] public string Title { get; } - [Key(5)] public string Kind { get; } - [Key(6)] public string CultMeshAddress { get; } - [Key(7)] public string UpdatedAtUtc { get; } - [Key(8)] public EveProviderFreshness Freshness { get; } - [Key(9)] public IReadOnlyList Schemas { get; } - [Key(10)] public IReadOnlyList Witnesses { get; } - [Key(11)] public IReadOnlyList Surfaces { get; } - [Key(12)] public IReadOnlyList Commands { get; } - } - - [MessagePackObject] - public sealed class EveProviderFreshness - { - [SerializationConstructor] - public EveProviderFreshness(string state, string lastSeenAtUtc, long maxAgeMs) - { - State = state ?? ""; - LastSeenAtUtc = lastSeenAtUtc ?? ""; - MaxAgeMs = maxAgeMs; - } - - [Key(0)] public string State { get; } - [Key(1)] public string LastSeenAtUtc { get; } - [Key(2)] public long MaxAgeMs { get; } - } - - [MessagePackObject] - public sealed class EveProviderWitness - { - [SerializationConstructor] - public EveProviderWitness(string kind, string reference, string summary) - { - Kind = kind ?? ""; - Reference = reference ?? ""; - Summary = summary ?? ""; - } - - [Key(0)] public string Kind { get; } - [Key(1)] public string Reference { get; } - [Key(2)] public string Summary { get; } - } - - [MessagePackObject] - public sealed class EveAdvertisedSurface - { - [SerializationConstructor] - public EveAdvertisedSurface( - string surfaceId, - string schema, - string recordRef, - string transport, - string status, - string surfaceKind, - EveWorldInteractionAdvertisement? worldInteraction = null) - { - SurfaceId = surfaceId ?? ""; - Schema = schema ?? ""; - RecordRef = recordRef ?? ""; - Transport = transport ?? ""; - Status = status ?? ""; - SurfaceKind = surfaceKind ?? ""; - WorldInteraction = worldInteraction; - } - - [Key(0)] public string SurfaceId { get; } - [Key(1)] public string Schema { get; } - [Key(2)] public string RecordRef { get; } - [Key(3)] public string Transport { get; } - [Key(4)] public string Status { get; } - [Key(5)] public string SurfaceKind { get; } - [Key(6)] public EveWorldInteractionAdvertisement? WorldInteraction { get; } - } - - [MessagePackObject] - public sealed class EveWorldInteractionAdvertisement - { - [SerializationConstructor] - public EveWorldInteractionAdvertisement( - string projectionKind, - IReadOnlyList stateSchemas, - string commandBoundary, - string commandRecordRef, - string receiptSchema, - string receiptRecordRef, - string assetManifestRecordRef, - IReadOnlyList loweringTargets, - string ownership) - { - ProjectionKind = projectionKind ?? ""; - StateSchemas = stateSchemas ?? Array.Empty(); - CommandBoundary = commandBoundary ?? ""; - CommandRecordRef = commandRecordRef ?? ""; - ReceiptSchema = receiptSchema ?? ""; - ReceiptRecordRef = receiptRecordRef ?? ""; - AssetManifestRecordRef = assetManifestRecordRef ?? ""; - LoweringTargets = loweringTargets ?? Array.Empty(); - Ownership = ownership ?? ""; - } - - [Key(0)] public string ProjectionKind { get; } - [Key(1)] public IReadOnlyList StateSchemas { get; } - [Key(2)] public string CommandBoundary { get; } - [Key(3)] public string CommandRecordRef { get; } - [Key(4)] public string ReceiptSchema { get; } - [Key(5)] public string ReceiptRecordRef { get; } - [Key(6)] public string AssetManifestRecordRef { get; } - [Key(7)] public IReadOnlyList LoweringTargets { get; } - [Key(8)] public string Ownership { get; } - } - - [MessagePackObject] - public sealed class EveAdvertisedCommand - { - [SerializationConstructor] - public EveAdvertisedCommand(string command, string surfaceId, string transport, string summary) - { - Command = command ?? ""; - SurfaceId = surfaceId ?? ""; - Transport = transport ?? ""; - Summary = summary ?? ""; - } - - [Key(0)] public string Command { get; } - [Key(1)] public string SurfaceId { get; } - [Key(2)] public string Transport { get; } - [Key(3)] public string Summary { get; } - } - - [CultDocument("gamecult.eve.command_receipt", SchemaId)] - [MessagePackObject] - public sealed class EveCommandReceiptDocument - { - public const string SchemaId = "gamecult.eve.command_receipt.v1"; - - public EveCommandReceiptDocument( - string receiptId, - string commandId, - string command, - string state, - string ownerRepo, - string authority, - string providerId, - string surfaceId, - string message, - string issuedAtUtc, - long sourceVersion) - : this(SchemaId, receiptId, commandId, command, state, ownerRepo, authority, providerId, surfaceId, message, issuedAtUtc, sourceVersion) - { - } - - [SerializationConstructor] - public EveCommandReceiptDocument( - string schema, - string receiptId, - string commandId, - string command, - string state, - string ownerRepo, - string authority, - string providerId, - string surfaceId, - string message, - string issuedAtUtc, - long sourceVersion) - { - Schema = string.IsNullOrWhiteSpace(schema) ? SchemaId : schema; - ReceiptId = receiptId ?? ""; - CommandId = commandId ?? ""; - Command = command ?? ""; - State = state ?? ""; - OwnerRepo = ownerRepo ?? ""; - Authority = authority ?? ""; - ProviderId = providerId ?? ""; - SurfaceId = surfaceId ?? ""; - Message = message ?? ""; - IssuedAtUtc = issuedAtUtc ?? ""; - SourceVersion = sourceVersion; - } - - [Key(0)] public string Schema { get; } - [Key(1)] public string ReceiptId { get; } - [Key(2)] public string CommandId { get; } - [Key(3)] public string Command { get; } - [Key(4)] public string State { get; } - [Key(5)] public string OwnerRepo { get; } - [Key(6)] public string Authority { get; } - [Key(7)] public string ProviderId { get; } - [Key(8)] public string SurfaceId { get; } - [Key(9)] public string Message { get; } - [Key(10)] public string IssuedAtUtc { get; } - [Key(11)] public long SourceVersion { get; } - } -} diff --git a/packages/org.gamecult.eve.surface/Runtime/EveProviderDocuments.cs.meta b/packages/org.gamecult.eve.surface/Runtime/EveProviderDocuments.cs.meta deleted file mode 100644 index f29c875..0000000 --- a/packages/org.gamecult.eve.surface/Runtime/EveProviderDocuments.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: f7ea0cd07c4d5da4099b5acf8d44ca2e \ No newline at end of file diff --git a/packages/org.gamecult.eve.surface/Runtime/EveSurfaceBuilder.cs b/packages/org.gamecult.eve.surface/Runtime/EveSurfaceBuilder.cs deleted file mode 100644 index 2d88eb5..0000000 --- a/packages/org.gamecult.eve.surface/Runtime/EveSurfaceBuilder.cs +++ /dev/null @@ -1,874 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using GameCult.Mesh; - -#nullable enable - -namespace GameCult.Eve.Surface -{ - /// - /// Fluent CultUI/Eve surface builder. Eve owns the surface document; CultMesh only supplies typed binding descriptors. - /// - public sealed class EveSurfaceBuilder - { - private readonly string _surfaceId; - private readonly List _children = new(); - private readonly List _styles = new(); - private readonly List _commands = new(); - private EveSurfaceComponent? _root; - private long _version = 1; - private string _providerId = "gamecult"; - private string _providerKind = "cultui.surface"; - private string _title = ""; - private string _updatedAtUtc = ""; - - public EveSurfaceBuilder(string surfaceId) - { - _surfaceId = RequireNonEmpty(surfaceId, nameof(surfaceId)); - } - - public EveSurfaceBuilder Provider(string providerId, string providerKind) - { - _providerId = providerId ?? ""; - _providerKind = providerKind ?? ""; - return this; - } - - public EveSurfaceBuilder Title(string title) - { - _title = title ?? ""; - _children.Add(Text($"{_surfaceId}.title", _title, "text.title")); - return this; - } - - public EveSurfaceBuilder TitleSubtitle(string title, string subtitle) - { - _title = string.IsNullOrWhiteSpace(subtitle) ? title ?? "" : $"{title} {subtitle}"; - _children.Add(Text($"{_surfaceId}.title", title ?? "", "text.title")); - _children.Add(Text($"{_surfaceId}.subtitle", subtitle ?? "", "text.subtitle")); - return this; - } - - public EveSurfaceBuilder Text(string text, string? id = null) - { - _children.Add(Text(id ?? $"{_surfaceId}.text.{_children.Count}", text, "text")); - return this; - } - - public EveSurfaceBuilder Button(string label, string command) - { - var operation = CultMesh.OperationBinding(command, label); - _commands.Add(new EveCommandTemplate(operation)); - _children.Add(ButtonComponent($"{_surfaceId}.button.{Slug(label)}", label, operation)); - return this; - } - - public EveSurfaceBuilder Button(string label, CultMeshOperationBindingDescriptor operation) - { - if (operation == null) throw new ArgumentNullException(nameof(operation)); - _commands.Add(new EveCommandTemplate(operation)); - _children.Add(ButtonComponent($"{_surfaceId}.button.{Slug(label)}", label, operation)); - return this; - } - - public EveSurfaceBuilder ButtonColumn(string id, Action build) - { - return Group(id, "column", build); - } - - public EveSurfaceBuilder ButtonRow(string id, Action build) - { - return Group(id, "row", build); - } - - public EveSurfaceBuilder Form(string id, Action build) - { - if (build == null) throw new ArgumentNullException(nameof(build)); - var form = new EveSurfaceFormBuilder(id, AddCommand); - build(form); - _children.Add(form.Build()); - return this; - } - - public EveSurfaceBuilder RootColumn(string id, Action build) - { - _root = BuildContainer(id, "partition", Props(("split", "y")), build); - return this; - } - - public EveSurfaceBuilder RootRow(string id, Action build) - { - _root = BuildContainer(id, "partition", Props(("split", "x")), build); - return this; - } - - public EveSurfaceBuilder RootGrid( - string id, - int columns, - int rows, - Action build) - { - _root = BuildContainer( - id, - "grid", - Props( - ("columns", columns.ToString(System.Globalization.CultureInfo.InvariantCulture)), - ("rows", rows.ToString(System.Globalization.CultureInfo.InvariantCulture))), - build); - return this; - } - - public EveSurfaceBuilder Row(string id, Action build) - { - _children.Add(BuildContainer(id, "partition", Props(("split", "x")), build)); - return this; - } - - public EveSurfaceBuilder Column(string id, Action build) - { - _children.Add(BuildContainer(id, "partition", Props(("split", "y")), build)); - return this; - } - - public EveSurfaceBuilder Grid(string id, int columns, int rows, Action build) - { - _children.Add(BuildContainer( - id, - "grid", - Props( - ("columns", columns.ToString(System.Globalization.CultureInfo.InvariantCulture)), - ("rows", rows.ToString(System.Globalization.CultureInfo.InvariantCulture))), - build)); - return this; - } - - public EveSurfaceBuilder Modal(string id, string title, Action build) - { - _children.Add(BuildContainer(id, "modal", Props(("title", title ?? "")), build)); - return this; - } - - public EveSurfaceBuilder EmbeddedDocument( - string slotId, - string documentId, - string schemaId, - string presentationKind, - CultMeshRouteHint? routeHint = null) - { - _children.Add(new EveSurfaceComponent( - $"{_surfaceId}.slot.{Slug(slotId)}", - "surface.slot", - new Dictionary(StringComparer.Ordinal) - { - ["slotId"] = slotId ?? "", - ["documentId"] = documentId ?? "", - ["schemaId"] = schemaId ?? "", - ["presentationKind"] = presentationKind ?? "" - }, - Array.Empty(), - Array.Empty(), - new[] - { - new EveEmbeddedDocumentSlot( - slotId ?? "", - documentId ?? "", - schemaId ?? "", - presentationKind ?? "", - routeHint) - })); - return this; - } - - public EveSurfaceBuilder Style(string name, string value) - { - _styles.Add(new EveStyleToken(name, value)); - return this; - } - - public EveSurfaceBuilder Version(long version) - { - _version = version; - return this; - } - - public EveSurfaceBuilder UpdatedAtUtc(string updatedAtUtc) - { - _updatedAtUtc = updatedAtUtc ?? ""; - return this; - } - - public EveSurfaceDocument Build() - { - return new EveSurfaceDocument( - _providerId, - _providerKind, - _title, - _version, - string.IsNullOrWhiteSpace(_updatedAtUtc) ? DateTime.UtcNow.ToString("O") : _updatedAtUtc, - new EveSurfaceTree( - _surfaceId, - _root ?? new EveSurfaceComponent( - $"{_surfaceId}.root", - "surface", - EmptyProps(), - _children.ToArray()), - _styles.ToArray()), - _commands.ToArray()); - } - - private EveSurfaceBuilder Group(string id, string kind, Action build) - { - if (build == null) throw new ArgumentNullException(nameof(build)); - var group = new EveSurfaceGroupBuilder(id, kind, AddCommand); - build(group); - _children.Add(group.Build()); - return this; - } - - private EveSurfaceComponent BuildContainer( - string id, - string kind, - IReadOnlyDictionary props, - Action build) - { - if (build == null) throw new ArgumentNullException(nameof(build)); - var container = new EveSurfaceContainerBuilder(id, kind, props, AddCommand); - build(container); - return container.Build(); - } - - private void AddCommand(EveCommandTemplate command) - { - if (command != null) - _commands.Add(command); - } - - internal static EveSurfaceComponent Text(string id, string value, string kind) - { - return new EveSurfaceComponent( - id, - kind, - new Dictionary(StringComparer.Ordinal) - { - ["value"] = value ?? "" - }, - Array.Empty()); - } - - internal static EveSurfaceComponent ButtonComponent( - string id, - string label, - CultMeshOperationBindingDescriptor operation) - { - return new EveSurfaceComponent( - id, - "control.button", - new Dictionary(StringComparer.Ordinal) - { - ["label"] = label ?? operation.Label, - ["command"] = operation.OperationId, - ["operationId"] = operation.OperationId, - ["schemaId"] = operation.SchemaId - }, - Array.Empty()); - } - - internal static Dictionary EmptyProps() - { - return new Dictionary(StringComparer.Ordinal); - } - - internal static Dictionary Props(params (string Key, string Value)[] values) - { - return (values ?? Array.Empty<(string Key, string Value)>()) - .ToDictionary(value => value.Key, value => value.Value ?? "", StringComparer.Ordinal); - } - - internal static string Slug(string? value) - { - if (string.IsNullOrWhiteSpace(value)) - return "unnamed"; - - var chars = value - .Select(character => char.IsLetterOrDigit(character) ? char.ToLowerInvariant(character) : '.') - .ToArray(); - var slug = new string(chars).Trim('.'); - while (slug.Contains("..", StringComparison.Ordinal)) - slug = slug.Replace("..", ".", StringComparison.Ordinal); - return string.IsNullOrWhiteSpace(slug) ? "unnamed" : slug; - } - - private static string RequireNonEmpty(string value, string paramName) - { - return string.IsNullOrWhiteSpace(value) - ? throw new ArgumentException("Value must be non-empty.", paramName) - : value; - } - } - - public sealed class EveSurfaceContainerBuilder - { - private readonly string _id; - private readonly string _kind; - private readonly Dictionary _props; - private readonly Action _addCommand; - private readonly List _children = new(); - private readonly List _stateBindings = new(); - private readonly List _embeddedDocuments = new(); - - internal EveSurfaceContainerBuilder( - string id, - string kind, - IReadOnlyDictionary props, - Action addCommand) - { - _id = id ?? ""; - _kind = kind ?? "partition"; - _props = new Dictionary(props ?? EveSurfaceBuilder.EmptyProps(), StringComparer.Ordinal); - _addCommand = addCommand ?? throw new ArgumentNullException(nameof(addCommand)); - } - - public EveSurfaceContainerBuilder Gap(int value) => Prop("gap", value); - - public EveSurfaceContainerBuilder Padding(int value) => Prop("padding", value); - - public EveSurfaceContainerBuilder Size(string value) => Prop("size", value); - - public EveSurfaceContainerBuilder Min(string value) => Prop("min", value); - - public EveSurfaceContainerBuilder Max(string value) => Prop("max", value); - - public EveSurfaceContainerBuilder Align(string value) => Prop("align", value); - - public EveSurfaceContainerBuilder Clip(string value = "hidden") => Prop("clip", value); - - public EveSurfaceContainerBuilder Scroll(string value = "y") => Prop("scroll", value); - - public EveSurfaceContainerBuilder Region(string value) => Prop("region", value); - - public EveSurfaceContainerBuilder Bind(CultMeshStateBindingDescriptor binding) - { - if (binding != null) - _stateBindings.Add(binding); - return this; - } - - public EveSurfaceContainerBuilder Row(string id, Action build) - { - _children.Add(BuildContainer(id, "partition", EveSurfaceBuilder.Props(("split", "x")), build)); - return this; - } - - public EveSurfaceContainerBuilder Column(string id, Action build) - { - _children.Add(BuildContainer(id, "partition", EveSurfaceBuilder.Props(("split", "y")), build)); - return this; - } - - public EveSurfaceContainerBuilder Grid( - string id, - int columns, - int rows, - Action build) - { - _children.Add(BuildContainer( - id, - "grid", - EveSurfaceBuilder.Props( - ("columns", columns.ToString(System.Globalization.CultureInfo.InvariantCulture)), - ("rows", rows.ToString(System.Globalization.CultureInfo.InvariantCulture))), - build)); - return this; - } - - public EveSurfaceContainerBuilder Pane(string id, string title, Action build) - { - _children.Add(BuildContainer(id, "pane", EveSurfaceBuilder.Props(("title", title ?? "")), build)); - return this; - } - - public EveSurfaceContainerBuilder Card(string id, string title, Action build) - { - _children.Add(BuildContainer(id, "card", EveSurfaceBuilder.Props(("title", title ?? "")), build)); - return this; - } - - public EveSurfaceContainerBuilder Modal(string id, string title, Action build) - { - _children.Add(BuildContainer(id, "modal", EveSurfaceBuilder.Props(("title", title ?? "")), build)); - return this; - } - - public EveSurfaceContainerBuilder FieldRow( - string id, - string label, - Action build) - { - return Row(id, row => row - .Gap(8) - .Label($"{id}.label", label, labelPart => labelPart.Size("12rem")) - .Column($"{id}.field", field => - { - field.Size("1fr"); - build(field); - })); - } - - public EveSurfaceContainerBuilder Label( - string id, - string text, - Action? configure = null) - { - return Leaf(id, "label", EveSurfaceBuilder.Props(("value", text ?? "")), null, null, configure); - } - - public EveSurfaceContainerBuilder Text(string id, string text) - { - return Leaf(id, "text", EveSurfaceBuilder.Props(("value", text ?? ""))); - } - - public EveSurfaceContainerBuilder Title(string id, string text) - { - return Leaf(id, "text.title", EveSurfaceBuilder.Props(("value", text ?? ""))); - } - - public EveSurfaceContainerBuilder Metric( - string id, - string label, - string value, - CultMeshStateBindingDescriptor? binding = null) - { - return Leaf( - id, - "metric", - EveSurfaceBuilder.Props(("label", label ?? ""), ("value", value ?? "")), - binding); - } - - public EveSurfaceContainerBuilder Progress( - string id, - string label, - string value, - string min, - string max, - CultMeshStateBindingDescriptor? binding = null) - { - return Leaf( - id, - "progress", - EveSurfaceBuilder.Props( - ("label", label ?? ""), - ("value", value ?? ""), - ("min", min ?? ""), - ("max", max ?? "")), - binding); - } - - public EveSurfaceContainerBuilder Button(string id, string label, string command) - { - return Button(id, label, CultMesh.OperationBinding(command, label)); - } - - public EveSurfaceContainerBuilder Button( - string id, - string label, - CultMeshOperationBindingDescriptor operation) - { - if (operation == null) throw new ArgumentNullException(nameof(operation)); - _addCommand(new EveCommandTemplate(operation)); - _children.Add(EveSurfaceBuilder.ButtonComponent(id, label, operation)); - return this; - } - - public EveSurfaceContainerBuilder PopupButton( - string id, - string label, - string title, - Action build, - string anchor = "viewport", - string placement = "center", - int offsetX = 0, - int offsetY = 0) - { - if (build == null) throw new ArgumentNullException(nameof(build)); - var popup = BuildContainer( - $"{id}.popup", - "modal", - EveSurfaceBuilder.Props( - ("title", title ?? label ?? ""), - ("anchor", anchor ?? "viewport"), - ("placement", placement ?? "center"), - ("offsetX", offsetX.ToString(System.Globalization.CultureInfo.InvariantCulture)), - ("offsetY", offsetY.ToString(System.Globalization.CultureInfo.InvariantCulture)), - ("presentation", "popover")), - build); - _children.Add(new EveSurfaceComponent( - id ?? "", - "control.popup", - EveSurfaceBuilder.Props( - ("label", label ?? ""), - ("title", title ?? label ?? ""), - ("anchor", anchor ?? "viewport"), - ("placement", placement ?? "center"), - ("offsetX", offsetX.ToString(System.Globalization.CultureInfo.InvariantCulture)), - ("offsetY", offsetY.ToString(System.Globalization.CultureInfo.InvariantCulture))), - new[] { popup })); - return this; - } - - public EveSurfaceContainerBuilder EnumField( - string id, - string label, - string value, - CultMeshStateBindingDescriptor optionsBinding, - CultMeshOperationBindingDescriptor setValue, - string anchor = "trigger", - string placement = "right-down") - { - return FieldRow(id, label, field => field.PopupButton( - $"{id}.dropdown", - value, - label, - popup => popup.OptionList($"{id}.options", label, optionsBinding, setValue), - anchor, - placement)); - } - - public EveSurfaceContainerBuilder OptionList( - string id, - string label, - CultMeshStateBindingDescriptor itemsBinding, - CultMeshOperationBindingDescriptor operation) - { - if (itemsBinding == null) throw new ArgumentNullException(nameof(itemsBinding)); - if (operation == null) throw new ArgumentNullException(nameof(operation)); - _addCommand(new EveCommandTemplate(operation)); - _children.Add(new EveSurfaceComponent( - id ?? "", - "options", - EveSurfaceBuilder.Props( - ("label", label ?? ""), - ("command", operation.OperationId), - ("operationId", operation.OperationId), - ("schemaId", operation.SchemaId)), - Array.Empty(), - new[] { itemsBinding })); - return this; - } - - public EveSurfaceContainerBuilder TextInput( - string id, - string label, - string value, - CultMeshOperationBindingDescriptor operation, - CultMeshStateBindingDescriptor? binding = null) - { - return Control("control.input.text", id, label, value, operation, binding); - } - - public EveSurfaceContainerBuilder Toggle( - string id, - string label, - bool value, - CultMeshOperationBindingDescriptor operation, - CultMeshStateBindingDescriptor? binding = null) - { - return Control("control.toggle", id, label, value ? "true" : "false", operation, binding); - } - - public EveSurfaceContainerBuilder Slider( - string id, - string label, - string value, - string min, - string max, - string step, - CultMeshOperationBindingDescriptor operation, - CultMeshStateBindingDescriptor? binding = null) - { - return Control( - "control.slider", - id, - label, - value, - operation, - binding, - ("min", min ?? ""), - ("max", max ?? ""), - ("step", step ?? "")); - } - - public EveSurfaceContainerBuilder Select( - string id, - string label, - string value, - CultMeshOperationBindingDescriptor operation, - CultMeshStateBindingDescriptor? binding = null) - { - return Control("control.select", id, label, value, operation, binding); - } - - public EveSurfaceContainerBuilder EmbeddedDocument( - string id, - string slotId, - string documentId, - string schemaId, - string presentationKind, - CultMeshRouteHint? routeHint = null) - { - _children.Add(new EveSurfaceComponent( - id ?? "", - "surface.slot", - EveSurfaceBuilder.Props( - ("slotId", slotId ?? ""), - ("documentId", documentId ?? ""), - ("schemaId", schemaId ?? ""), - ("presentationKind", presentationKind ?? "")), - Array.Empty(), - Array.Empty(), - new[] - { - new EveEmbeddedDocumentSlot( - slotId ?? "", - documentId ?? "", - schemaId ?? "", - presentationKind ?? "", - routeHint) - })); - return this; - } - - internal EveSurfaceComponent Build() - { - return new EveSurfaceComponent( - _id, - _kind, - _props, - _children.ToArray(), - _stateBindings.ToArray(), - _embeddedDocuments.ToArray()); - } - - private EveSurfaceContainerBuilder Prop(string key, int value) - { - _props[key] = value.ToString(System.Globalization.CultureInfo.InvariantCulture); - return this; - } - - private EveSurfaceContainerBuilder Prop(string key, string value) - { - _props[key] = value ?? ""; - return this; - } - - private EveSurfaceContainerBuilder Leaf( - string id, - string kind, - IReadOnlyDictionary props, - CultMeshStateBindingDescriptor? binding = null, - IReadOnlyList? children = null, - Action? configure = null) - { - var builder = new EveSurfaceContainerBuilder(id, kind, props, _addCommand); - configure?.Invoke(builder); - var component = new EveSurfaceComponent( - id ?? "", - kind ?? "", - new Dictionary(props ?? EveSurfaceBuilder.EmptyProps(), StringComparer.Ordinal), - children ?? Array.Empty(), - binding == null ? Array.Empty() : new[] { binding }); - if (builder._props.Count != (props?.Count ?? 0)) - { - component = new EveSurfaceComponent( - id ?? "", - kind ?? "", - new Dictionary(builder._props, StringComparer.Ordinal), - children ?? Array.Empty(), - binding == null ? Array.Empty() : new[] { binding }); - } - _children.Add(component); - return this; - } - - private EveSurfaceContainerBuilder Control( - string kind, - string id, - string label, - string value, - CultMeshOperationBindingDescriptor operation, - CultMeshStateBindingDescriptor? binding, - params (string Key, string Value)[] extraProps) - { - if (operation == null) throw new ArgumentNullException(nameof(operation)); - _addCommand(new EveCommandTemplate(operation)); - var props = EveSurfaceBuilder.Props( - new[] - { - ("label", label ?? ""), - ("value", value ?? ""), - ("command", operation.OperationId), - ("operationId", operation.OperationId), - ("schemaId", operation.SchemaId) - }.Concat(extraProps ?? Array.Empty<(string Key, string Value)>()).ToArray()); - return Leaf(kind: kind, id: id, props: props, binding: binding); - } - - private EveSurfaceComponent BuildContainer( - string id, - string kind, - IReadOnlyDictionary props, - Action build) - { - if (build == null) throw new ArgumentNullException(nameof(build)); - var container = new EveSurfaceContainerBuilder(id, kind, props, _addCommand); - build(container); - return container.Build(); - } - } - - public sealed class EveSurfaceGroupBuilder - { - private readonly string _id; - private readonly string _kind; - private readonly Action _addCommand; - private readonly List _children = new(); - - internal EveSurfaceGroupBuilder( - string id, - string kind, - Action addCommand) - { - _id = id ?? ""; - _kind = kind ?? "column"; - _addCommand = addCommand ?? throw new ArgumentNullException(nameof(addCommand)); - } - - public EveSurfaceGroupBuilder Button(string label, string command) - { - var operation = CultMesh.OperationBinding(command, label); - _addCommand(new EveCommandTemplate(operation)); - _children.Add(EveSurfaceBuilder.ButtonComponent($"{_id}.button.{EveSurfaceBuilder.Slug(label)}", label, operation)); - return this; - } - - public EveSurfaceGroupBuilder Button(string label, CultMeshOperationBindingDescriptor operation) - { - if (operation == null) throw new ArgumentNullException(nameof(operation)); - _addCommand(new EveCommandTemplate(operation)); - _children.Add(EveSurfaceBuilder.ButtonComponent($"{_id}.button.{EveSurfaceBuilder.Slug(label)}", label, operation)); - return this; - } - - internal EveSurfaceComponent Build() - { - return new EveSurfaceComponent(_id, _kind, EveSurfaceBuilder.EmptyProps(), _children.ToArray()); - } - } - - public sealed class EveSurfaceFormBuilder - { - private readonly string _id; - private readonly Action _addCommand; - private readonly List _children = new(); - - internal EveSurfaceFormBuilder(string id, Action addCommand) - { - _id = id ?? ""; - _addCommand = addCommand ?? throw new ArgumentNullException(nameof(addCommand)); - } - - public EveSurfaceFormBuilder Text( - string label, - string value, - CultMeshOperationBindingDescriptor operation, - CultMeshStateBindingDescriptor? binding = null) - { - if (operation == null) throw new ArgumentNullException(nameof(operation)); - _addCommand(new EveCommandTemplate(operation)); - _children.Add(Control( - "control.text", - label, - value, - operation, - binding)); - return this; - } - - public EveSurfaceFormBuilder Toggle( - string label, - bool value, - CultMeshOperationBindingDescriptor operation, - CultMeshStateBindingDescriptor? binding = null) - { - if (operation == null) throw new ArgumentNullException(nameof(operation)); - _addCommand(new EveCommandTemplate(operation)); - _children.Add(Control( - "control.toggle", - label, - value ? "true" : "false", - operation, - binding)); - return this; - } - - public EveSurfaceFormBuilder Metric( - string label, - string value, - CultMeshStateBindingDescriptor? binding = null) - { - var bindings = binding == null - ? Array.Empty() - : new[] { binding }; - _children.Add(new EveSurfaceComponent( - $"{_id}.metric.{EveSurfaceBuilder.Slug(label)}", - "metric", - new Dictionary(StringComparer.Ordinal) - { - ["label"] = label ?? "", - ["value"] = value ?? "" - }, - Array.Empty(), - bindings)); - return this; - } - - internal EveSurfaceComponent Build() - { - return new EveSurfaceComponent(_id, "form", EveSurfaceBuilder.EmptyProps(), _children.ToArray()); - } - - private EveSurfaceComponent Control( - string kind, - string label, - string value, - CultMeshOperationBindingDescriptor operation, - CultMeshStateBindingDescriptor? binding) - { - var bindings = binding == null - ? Array.Empty() - : new[] { binding }; - return new EveSurfaceComponent( - $"{_id}.{EveSurfaceBuilder.Slug(label)}", - kind, - new Dictionary(StringComparer.Ordinal) - { - ["label"] = label ?? "", - ["value"] = value ?? "", - ["command"] = operation.OperationId, - ["operationId"] = operation.OperationId, - ["schemaId"] = operation.SchemaId - }, - Array.Empty(), - bindings); - } - } - - public static class EveSurface - { - public static EveSurfaceBuilder Create(string surfaceId) - { - return new EveSurfaceBuilder(surfaceId); - } - } -} diff --git a/packages/org.gamecult.eve.surface/Runtime/EveSurfaceBuilder.cs.meta b/packages/org.gamecult.eve.surface/Runtime/EveSurfaceBuilder.cs.meta deleted file mode 100644 index adc41da..0000000 --- a/packages/org.gamecult.eve.surface/Runtime/EveSurfaceBuilder.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 97ac7f757692aef4db64d75d0df6fe51 \ No newline at end of file diff --git a/packages/org.gamecult.eve.surface/Runtime/EveSurfaceDocument.cs b/packages/org.gamecult.eve.surface/Runtime/EveSurfaceDocument.cs deleted file mode 100644 index c4eb051..0000000 --- a/packages/org.gamecult.eve.surface/Runtime/EveSurfaceDocument.cs +++ /dev/null @@ -1,414 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using GameCult.Caching; -using GameCult.Mesh; -using MessagePack; - -#nullable enable - -namespace GameCult.Eve.Surface -{ - [CultDocument("gamecult.eve.surface", "gamecult.eve.surface.v1")] - [MessagePackObject] - public sealed class EveSurfaceDocument - { - public const string DefaultType = "surface-state"; - public const string SchemaId = "gamecult.eve.surface.v1"; - - public EveSurfaceDocument( - string providerId, - string providerKind, - string title, - long version, - string updatedAtUtc, - EveSurfaceTree surface, - IReadOnlyList commands) - : this(DefaultType, SchemaId, providerId, providerKind, title, version, updatedAtUtc, surface, commands) - { - } - - [SerializationConstructor] - public EveSurfaceDocument( - string type, - string schema, - string providerId, - string providerKind, - string title, - long version, - string updatedAtUtc, - EveSurfaceTree surface, - IReadOnlyList commands) - { - Type = string.IsNullOrWhiteSpace(type) ? DefaultType : type; - Schema = string.IsNullOrWhiteSpace(schema) ? SchemaId : schema; - ProviderId = providerId ?? ""; - ProviderKind = providerKind ?? ""; - Title = title ?? ""; - Version = version; - UpdatedAtUtc = updatedAtUtc ?? ""; - Surface = surface ?? throw new ArgumentNullException(nameof(surface)); - Commands = commands ?? Array.Empty(); - } - - [Key(0)] - public string Type { get; } - - [Key(1)] - public string Schema { get; } - - [Key(2)] - public string ProviderId { get; } - - [Key(3)] - public string ProviderKind { get; } - - [Key(4)] - public string Title { get; } - - [Key(5)] - public long Version { get; } - - [Key(6)] - public string UpdatedAtUtc { get; } - - [Key(7)] - public EveSurfaceTree Surface { get; } - - [Key(8)] - public IReadOnlyList Commands { get; } - } - - [MessagePackObject] - public sealed class EveSurfaceTree - { - [SerializationConstructor] - public EveSurfaceTree(string id, EveSurfaceComponent root, IReadOnlyList styles) - { - Id = id ?? ""; - Root = root ?? throw new ArgumentNullException(nameof(root)); - Styles = styles ?? Array.Empty(); - } - - [Key(0)] - public string Id { get; } - - [Key(1)] - public EveSurfaceComponent Root { get; } - - [Key(2)] - public IReadOnlyList Styles { get; } - } - - [MessagePackObject] - public sealed class EveSurfaceComponent - { - public EveSurfaceComponent( - string id, - string kind, - IReadOnlyDictionary props, - IReadOnlyList children) - : this(id, kind, props, children, StateBindingsFromProps(props)) - { - } - - public EveSurfaceComponent( - string id, - string kind, - IReadOnlyDictionary props, - IReadOnlyList children, - IReadOnlyList stateBindings) - : this(id, kind, props, children, stateBindings, Array.Empty()) - { - } - - public EveSurfaceComponent( - string id, - string kind, - IReadOnlyDictionary props, - IReadOnlyList children, - IReadOnlyList stateBindings, - IReadOnlyList embeddedDocuments, - IReadOnlyDictionary? layout = null, - IReadOnlyDictionary? style = null) - : this( - id, - kind, - props, - children, - (stateBindings ?? Array.Empty()) - .Select(CultMeshStateBindingRecord.FromBinding) - .ToArray(), - embeddedDocuments, - layout, - style) - { - } - - [SerializationConstructor] - public EveSurfaceComponent( - string id, - string kind, - IReadOnlyDictionary props, - IReadOnlyList children, - CultMeshStateBindingRecord[] stateBindingRecords, - IReadOnlyList embeddedDocuments, - IReadOnlyDictionary? layout = null, - IReadOnlyDictionary? style = null) - { - Id = id ?? ""; - Kind = kind ?? ""; - Props = props ?? new Dictionary(StringComparer.Ordinal); - Children = children ?? Array.Empty(); - StateBindingRecords = stateBindingRecords ?? Array.Empty(); - EmbeddedDocuments = embeddedDocuments ?? Array.Empty(); - Layout = layout ?? new Dictionary(StringComparer.Ordinal); - Style = style ?? new Dictionary(StringComparer.Ordinal); - } - - [Key(0)] - public string Id { get; } - - [Key(1)] - public string Kind { get; } - - [Key(2)] - public IReadOnlyDictionary Props { get; } - - [Key(3)] - public IReadOnlyList Children { get; } - - [Key(4)] - public CultMeshStateBindingRecord[] StateBindingRecords { get; } - - [IgnoreMember] - public IReadOnlyList StateBindings => - StateBindingRecords.Select(record => record.ToBinding()).ToArray(); - - [Key(5)] - public IReadOnlyList EmbeddedDocuments { get; } - - [Key(6)] - public IReadOnlyDictionary Layout { get; } - - [Key(7)] - public IReadOnlyDictionary Style { get; } - - public string GetProp(string key, string fallback = "") - { - return Props.TryGetValue(key, out var value) ? value : fallback; - } - - private static IReadOnlyList StateBindingsFromProps( - IReadOnlyDictionary? props) - { - if (props == null || props.Count == 0) - return Array.Empty(); - - var bindings = new List(); - foreach (var prop in props) - { - if (string.IsNullOrWhiteSpace(prop.Value) || - !prop.Key.EndsWith("PointerId", StringComparison.Ordinal)) - { - continue; - } - - var targetProp = prop.Key.Substring(0, prop.Key.Length - "PointerId".Length); - if (targetProp.Length == 0) - targetProp = "value"; - bindings.Add(new CultMeshStateBindingDescriptor(targetProp, prop.Value)); - } - - return bindings; - } - } - - [MessagePackObject] - public sealed class EveEmbeddedDocumentSlot - { - public EveEmbeddedDocumentSlot( - string slotId, - string documentId, - string schemaId, - string presentationKind, - CultMeshRouteHint? routeHint = null) - : this(slotId, documentId, schemaId, presentationKind, CultMeshRouteRecord.FromRoute(routeHint)) - { - } - - [SerializationConstructor] - public EveEmbeddedDocumentSlot( - string slotId, - string documentId, - string schemaId, - string presentationKind, - CultMeshRouteRecord route) - { - SlotId = slotId ?? ""; - DocumentId = documentId ?? ""; - SchemaId = schemaId ?? ""; - PresentationKind = presentationKind ?? ""; - Route = route ?? CultMeshRouteRecord.FromRoute(CultMeshRouteHint.Automatic); - } - - [Key(0)] - public string SlotId { get; } - - [Key(1)] - public string DocumentId { get; } - - [Key(2)] - public string SchemaId { get; } - - [Key(3)] - public string PresentationKind { get; } - - [Key(4)] - public CultMeshRouteRecord Route { get; } - - [IgnoreMember] - public CultMeshRouteHint RouteHint => Route.ToRoute(); - } - - [MessagePackObject] - public sealed class EveStyleToken - { - [SerializationConstructor] - public EveStyleToken(string name, string value) - { - Name = name ?? ""; - Value = value ?? ""; - } - - [Key(0)] - public string Name { get; } - - [Key(1)] - public string Value { get; } - } - - [MessagePackObject] - public sealed class EveCommandTemplate - { - public EveCommandTemplate(CultMeshOperationBindingDescriptor operation) - : this(CultMeshOperationBindingRecord.FromBinding(operation)) - { - } - - [SerializationConstructor] - public EveCommandTemplate(CultMeshOperationBindingRecord operationRecord) - { - OperationRecord = operationRecord ?? throw new ArgumentNullException(nameof(operationRecord)); - } - - [Key(0)] - public CultMeshOperationBindingRecord OperationRecord { get; } - - [IgnoreMember] - public CultMeshOperationBindingDescriptor Operation => OperationRecord.ToBinding(); - - [IgnoreMember] - public string Command => Operation.OperationId; - - [IgnoreMember] - public string Label => Operation.Label; - - [IgnoreMember] - public string Transport => Operation.RouteHint.Description ?? ""; - } - - [CultDocument("gamecult.eve.command", SchemaId)] - [MessagePackObject] - public sealed class EveSurfaceCommandRequest - { - public const string SchemaId = "gamecult.eve.command_invocation.v1"; - - public EveSurfaceCommandRequest( - string providerId, - string surfaceId, - CultMeshOperationInvocationDescriptor operation, - CultMeshOperationPayload payload, - DateTimeOffset issuedAt, - string clientId, - string commandBoundary = "", - string receiptSchema = "") - : this( - SchemaId, - providerId, - surfaceId, - CultMeshOperationInvocationRecord.FromInvocation(operation), - payload?.ToDictionary(entry => entry.Key, entry => entry.Value, StringComparer.Ordinal) - ?? new Dictionary(StringComparer.Ordinal), - issuedAt, - clientId, - commandBoundary, - receiptSchema) - { - } - - [SerializationConstructor] - public EveSurfaceCommandRequest( - string schema, - string providerId, - string surfaceId, - CultMeshOperationInvocationRecord operation, - Dictionary payload, - DateTimeOffset issuedAt, - string clientId, - string commandBoundary, - string receiptSchema) - { - Schema = string.IsNullOrWhiteSpace(schema) ? SchemaId : schema; - ProviderId = providerId; - SurfaceId = surfaceId; - OperationRecord = operation ?? throw new ArgumentNullException(nameof(operation)); - PayloadFields = payload == null - ? new Dictionary(StringComparer.Ordinal) - : new Dictionary(payload, StringComparer.Ordinal); - IssuedAt = issuedAt; - ClientId = clientId; - CommandBoundary = commandBoundary ?? ""; - ReceiptSchema = receiptSchema ?? ""; - } - - [Key(0)] - public string Schema { get; } - - [Key(1)] - public string ProviderId { get; } - - [Key(2)] - public string SurfaceId { get; } - - [Key(3)] - public CultMeshOperationInvocationRecord OperationRecord { get; } - - [IgnoreMember] - public CultMeshOperationInvocationDescriptor Operation => OperationRecord.ToInvocation(); - - [IgnoreMember] - public string Command => Operation.OperationId; - - [Key(4)] - public Dictionary PayloadFields { get; } - - [IgnoreMember] - public CultMeshOperationPayload Payload => new CultMeshOperationPayload(PayloadFields); - - [Key(5)] - public DateTimeOffset IssuedAt { get; } - - [Key(6)] - public string ClientId { get; } - - [Key(7)] - public string CommandBoundary { get; } - - [Key(8)] - public string ReceiptSchema { get; } - - [IgnoreMember] - public string CommandId => Operation.IdempotencyKey ?? ""; - } -} diff --git a/packages/org.gamecult.eve.surface/Runtime/EveSurfaceDocument.cs.meta b/packages/org.gamecult.eve.surface/Runtime/EveSurfaceDocument.cs.meta deleted file mode 100644 index ebd5f02..0000000 --- a/packages/org.gamecult.eve.surface/Runtime/EveSurfaceDocument.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 6516c42104b235f42b15efeb4639bb73 \ No newline at end of file diff --git a/packages/org.gamecult.eve.surface/Runtime/GameCult.Eve.Surface.asmdef b/packages/org.gamecult.eve.surface/Runtime/GameCult.Eve.Surface.asmdef deleted file mode 100644 index 8041c88..0000000 --- a/packages/org.gamecult.eve.surface/Runtime/GameCult.Eve.Surface.asmdef +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "GameCult.Eve.Surface", - "rootNamespace": "GameCult.Eve.Surface", - "references": [ - "GameCult.Mesh" - ], - "includePlatforms": [], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": true, - "precompiledReferences": [ - "GameCult.Caching.dll", - "GameCult.Mesh.dll", - "MessagePack.Annotations.dll" - ], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": true -} diff --git a/packages/org.gamecult.eve.surface/Runtime/GameCult.Eve.Surface.asmdef.meta b/packages/org.gamecult.eve.surface/Runtime/GameCult.Eve.Surface.asmdef.meta deleted file mode 100644 index d8f543e..0000000 --- a/packages/org.gamecult.eve.surface/Runtime/GameCult.Eve.Surface.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: a9004278c14816345941af2f2ce673ca -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/packages/org.gamecult.eve.surface/package.json b/packages/org.gamecult.eve.surface/package.json deleted file mode 100644 index 8d57c63..0000000 --- a/packages/org.gamecult.eve.surface/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "org.gamecult.eve.surface", - "displayName": "Eve Surface Contract", - "version": "0.1.0", - "unity": "2021.3", - "description": "Unity-compatible DTOs for gamecult.eve.surface.v1 documents.", - "dependencies": { - "org.gamecult.cultlib": "1.0.3" - }, - "keywords": [ - "Eve", - "CultUI", - "CultMesh", - "Surface" - ], - "license": "MPL-2.0", - "category": "Scripting" -} diff --git a/packages/org.gamecult.eve.surface/package.json.meta b/packages/org.gamecult.eve.surface/package.json.meta deleted file mode 100644 index 8e89223..0000000 --- a/packages/org.gamecult.eve.surface/package.json.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 49f1738bd94075e489c82190cf660b1d -PackageManifestImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/packages/org.gamecult.eve.unity-uitoolkit/README.md b/packages/org.gamecult.eve.unity-uitoolkit/README.md deleted file mode 100644 index f61b026..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/README.md +++ /dev/null @@ -1,150 +0,0 @@ -# Eve UI Toolkit Lowering - -This package lowers `gamecult.eve.surface.v1` retained surface documents into -Unity UI Toolkit `VisualElement` trees. - -It owns native projection only. Providers still own truth, accepted state, -style token values, and command effects through CultMesh/CultNet. Unknown -component kinds degrade to inert containers instead of gaining local semantics. - -Plugin semantics enter through plugin ABI sidecars and advertisements, not -through Unity. This package includes first-party projection adapters for the -`sai.vn` projection surface (`vn.stage`, dialogue panels, action rails, and -story command requests), the `norn.graph` projection surface (`embed.norn`), -and the `tex.math` source-fallback projection surface (`embed.tex`, -`tex.inline`, and `tex.block`). Sai still owns story state and command -semantics. Norn still owns graph layout and graph semantics. TeX still owns -parsing, typesetting, baseline metrics, and cached render semantics. Unity only -owns native projection of already-declared plugin capabilities and emits -`gamecult.eve.command.v1` requests. - -This package lives in the Eve repository as the shared Unity lowering target. -Aetheria and other Unity consumers should import it from Eve instead of -carrying local copies. - -Nested CultUI regions use component `EmbeddedDocuments`. Pass an -`EmbeddedDocumentResolver` through `EveUiToolkitSurfaceOptions`; the lowerer -mounts the resolved child surface under the slot while preserving the child -document's command surface id. - -Discovery and test coverage for this feature live in the shared Eve parity -matrix: `../../tools/parity/parity-manifest.json` names `embeddedDocuments` and -`../../web/fixtures/cultui-embedded-surface.json` is the canonical fixture. -Unity consumers should keep verifier coverage that builds a parent surface with -a resolver-backed child, then checks for the embedded visual element rather than -copying child state into a local adapter. - -The runtime capability manifest is -`eve-runtime-capability.json`. Its lifecycle section records the current split -evidence: - -- release: typed UPM release request contract, UPM `.tgz` artifact smoke, and - incubating package identity; -- test: package-owned EditMode tests run through Aetheria in Unity batchmode, - plus Aetheria consumer-build smoke through Unity's generated project; -- capture: typed capture request contract and pending Unity editor or - batchmode PNG artifact. - -The release stage also declares the UPM release contract: -`org.gamecult.eve.unity-uitoolkit` is released from this package root, reads -its version from `package.json`, and uses tag pattern -`eveunity-uitoolkit-v{version}` once the tag is cut from EveUnity. -`tools/eveunity/eveunity-release-contract.mjs` builds a -`gamecult.eve.runtime_release_request.v1` request from the runtime capability -manifest and UPM package manifest. The request names the package version, tag, -artifact path, dependency set, required package dependency owners, and target -`GameCult/EveUnity` repository without pretending Eve has published the tagged -release. -`tools/eveunity/eveunity-release-artifact.mjs` consumes that request and runs -`npm pack` against the declared package root, producing the declared -`org.gamecult.eve.unity-uitoolkit-{version}.tgz` artifact as local smoke -evidence. The tagged release still belongs in the EveUnity repo. - -The test stage declares the Unity EditMode runner contract: the current runner -is `scripts/run-aetheria-unity-editmode-tests.ps1`, runs -`GameCult.Eve.UnityUIToolkit.Tests` on `EditMode`, writes XML and log artifacts -under `artifacts/aetheria-unity-editmode/{stamp}`, and temporarily adds -`org.gamecult.eve.unity-uitoolkit` to Aetheria's Unity `testables`. This is a -Unity package consumption proof. The test contract names the CultLib-owned -NuGet/precompiled assembly inputs Unity needs during incubation; CultLib still -owns the .NET/NuGet dependency story for its assemblies. -Each managed dependency record carries a nested `dependencyContract` naming -CultLib as `sourceAuthority`, `nuget` as `packageSource`, the package id, -assembly name, version policy, Unity incubation resolution mode, and the -handoff requirement for EveUnity. This is not Eve inventing a second dependency -system. It is EveUnity declaring the assemblies it consumes while CultLib keeps -the package authority. - -The capture stage declares `gamecult.eve.runtime_capture_request.v1` request -construction through `tools/eveunity/eveunity-capture-contract.mjs`. That -request is derived from the runtime capability manifest and Aetheria's provider -advertisement, then points at the PNG artifact EveUnity must produce later. It -does not fake a screenshot; it makes the capture input contract executable. -`tools/eveunity/eveunity-uitoolkit-capture-artifact.mjs` also emits a typed -`gamecult.eve.unity_uitoolkit_projection.v1` JSON projection artifact for the -Aetheria world surface. That artifact is runtime projection evidence, not -provider state and not a Unity frame capture. - -The manifest also declares `worldSurfaceLowering` target `unity-uitoolkit`. -That means this package can lower provider-advertised `interactive-world` and -`interactive-world-editor` surfaces as semantic UI Toolkit command surfaces. -It does not claim Unity scene/world simulation ownership; Aetheria still owns -world state, assets, command acceptance, and receipts. - -Those lifecycle claims are validated by the parity harness. A missing evidence -path is a runtime capability error, not a README footnote. - -The split handoff manifest is `eveunity-split-handoff.json`. It is the -machine-readable map of what EveUnity must carry out of Eve incubation: the UPM -package body, the Unity test lifecycle, the Unity capture lifecycle, the Eve -contracts it consumes, and the forbidden imports it must not use as shortcuts. -It does not make the package ready to split by itself; it makes the remaining -release, test, and capture blockers inspectable. - -From the repository root, run the split lifecycle smoke with: - -```powershell -powershell -ExecutionPolicy Bypass -File .\scripts\run-eveunity-lifecycle-smoke.ps1 -``` - -That smoke validates `eve-runtime-capability.json`, checks lifecycle evidence -paths, builds the UPM artifact smoke, runs the Aetheria Unity package -consumer-build smoke, and verifies the split handoff manifest. Pass -`-RunUnityEditMode` when the local Unity editor should also execute the -incubating batchmode EditMode test runner. The final tagged UPM release, -batchmode runner ownership, and capture artifact still graduate to `EveUnity`. -The capture contract smoke is: - -```powershell -powershell -ExecutionPolicy Bypass -File .\scripts\run-eveunity-capture-contract-smoke.ps1 -``` - -The semantic projection capture smoke is: - -```powershell -powershell -ExecutionPolicy Bypass -File .\scripts\run-eveunity-uitoolkit-capture-smoke.ps1 -``` - -The release contract smoke is: - -```powershell -powershell -ExecutionPolicy Bypass -File .\scripts\run-eveunity-release-contract-smoke.ps1 -``` - -The release artifact smoke is: - -```powershell -powershell -ExecutionPolicy Bypass -File .\scripts\run-eveunity-release-artifact-smoke.ps1 -``` - -For Aetheria, the Unity evidence path is: - -- `powershell -ExecutionPolicy Bypass -File ..\..\scripts\run-aetheria-unity-package-smoke.ps1` -- `powershell -ExecutionPolicy Bypass -File ..\..\scripts\run-aetheria-unity-editmode-tests.ps1` - -The EditMode test asmdef declares Unity precompiled references for the -Brokkr/CultMesh DLLs Unity needs to resolve `GameCult.Mesh`. That is Unity -assembly plumbing, not a claim that CultLib lacks NuGet/.NET packaging. - -Those checks sit alongside Eve's shared browser, Flutter, iOS, Android/Kotlin, -and Rust contract tests, all discoverable from the parity manifest. diff --git a/packages/org.gamecult.eve.unity-uitoolkit/README.md.meta b/packages/org.gamecult.eve.unity-uitoolkit/README.md.meta deleted file mode 100644 index 8844c0d..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/README.md.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 9dabe4b47bd743f41a4c0903fd309eae -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Runtime.meta b/packages/org.gamecult.eve.unity-uitoolkit/Runtime.meta deleted file mode 100644 index b653c25..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Runtime.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 40e1d9868e9fdbf408ac5bc46239c817 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceLowerer.cs b/packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceLowerer.cs deleted file mode 100644 index f989ccf..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceLowerer.cs +++ /dev/null @@ -1,547 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using GameCult.Eve.Surface; -using UnityEngine; -using UnityEngine.UIElements; - -#nullable enable - -namespace GameCult.Eve.UnityUIToolkit -{ - public sealed class EveUiToolkitSurfaceLowerer - { - private readonly EveUiToolkitSurfaceOptions _options; - - public EveUiToolkitSurfaceLowerer(EveUiToolkitSurfaceOptions? options = null) - { - _options = options ?? EveUiToolkitSurfaceOptions.Default; - } - - public VisualElement Lower(EveSurfaceDocument document, Action? commandSink = null) - { - if (document == null) throw new ArgumentNullException(nameof(document)); - - var root = LowerComponent(document.Surface.Root, document, commandSink); - root.name = string.IsNullOrWhiteSpace(root.name) ? document.Surface.Id : root.name; - root.AddToClassList("eve-surface-root"); - ApplyStyleTokens(root, document.Surface.Styles); - return root; - } - - private VisualElement LowerComponent( - EveSurfaceComponent component, - EveSurfaceDocument document, - Action? commandSink) - { - var element = CreateElement(component, document, commandSink); - element.name = SafeName(component.Id); - element.AddToClassList("eve-component"); - element.AddToClassList($"eve-kind-{SafeClass(component.Kind)}"); - element.userData = component; - ApplyGeneratedLayout(element, component); - - foreach (var child in component.Children) - element.Add(LowerComponent(child, document, commandSink)); - - foreach (var slot in component.EmbeddedDocuments) - { - var nested = LowerEmbeddedDocument(slot, commandSink); - if (nested != null) - element.Add(nested); - } - - return element; - } - - private VisualElement? LowerEmbeddedDocument( - EveEmbeddedDocumentSlot slot, - Action? commandSink) - { - var document = _options.EmbeddedDocumentResolver?.Invoke(slot); - if (document == null) - return null; - - var element = LowerComponent(document.Surface.Root, document, commandSink); - element.name = SafeName(string.IsNullOrWhiteSpace(slot.SlotId) ? document.Surface.Id : slot.SlotId); - element.AddToClassList("eve-embedded-document"); - element.AddToClassList($"eve-embedded-kind-{SafeClass(slot.PresentationKind)}"); - ApplyStyleTokens(element, document.Surface.Styles); - return element; - } - - private VisualElement CreateElement( - EveSurfaceComponent component, - EveSurfaceDocument document, - Action? commandSink) - { - var projectionAdapter = _options.FindPluginProjectionAdapter(component); - if (projectionAdapter != null) - return projectionAdapter.Lower(component, document, commandSink); - - switch (NormalizeKind(component.Kind)) - { - case "surface": - { - var element = new VisualElement(); - element.style.flexGrow = 1; - element.style.flexDirection = FlexDirection.Column; - return element; - } - case "grid": - { - var element = new VisualElement(); - element.style.flexDirection = FlexDirection.Row; - element.style.flexWrap = Wrap.Wrap; - element.style.alignItems = Align.Stretch; - return element; - } - case "partition": - { - var element = new VisualElement(); - element.style.flexDirection = component.GetProp("split") == "x" - ? FlexDirection.Row - : FlexDirection.Column; - element.style.flexWrap = Wrap.Wrap; - return element; - } - case "pane": - case "modal": - case "card": - { - var card = new VisualElement(); - card.AddToClassList("eve-card"); - card.style.flexDirection = FlexDirection.Column; - var title = component.GetProp("title"); - if (!string.IsNullOrWhiteSpace(title)) - card.Add(TitleLabel(title)); - return card; - } - case "metric": - { - var metric = new VisualElement(); - metric.AddToClassList("eve-metric"); - metric.style.flexDirection = FlexDirection.Column; - metric.Add(MutedLabel(component.GetProp("label"))); - metric.Add(ValueLabel(component.GetProp("value"))); - return metric; - } - case "progress": - { - var progress = new VisualElement(); - progress.AddToClassList("eve-progress"); - progress.style.flexDirection = FlexDirection.Column; - progress.Add(MutedLabel(component.GetProp("label"))); - progress.Add(ValueLabel(component.GetProp("value"))); - return progress; - } - case "options": - { - var options = new VisualElement(); - options.AddToClassList("eve-options"); - options.style.flexDirection = FlexDirection.Column; - var label = component.GetProp("label"); - if (!string.IsNullOrWhiteSpace(label)) - options.Add(TitleLabel(label)); - return options; - } - case "inspector.kv": - { - var inspector = new VisualElement(); - inspector.AddToClassList("eve-inspector"); - inspector.style.flexDirection = FlexDirection.Column; - return inspector; - } - case "row": - { - var row = new VisualElement(); - row.AddToClassList("eve-row"); - row.style.flexDirection = FlexDirection.Row; - row.style.flexWrap = Wrap.Wrap; - foreach (var prop in component.Props) - row.Add(FieldLabel(prop.Key, prop.Value)); - return row; - } - case "text": - { - return BodyLabel(component.GetProp("text", component.GetProp("value", component.GetProp("title")))); - } - case "control.button": - case "control.popup": - { - var label = component.GetProp("label", component.GetProp("title", "Invoke")); - var command = component.GetProp("command", component.GetProp("action", "invoke")); - return new Button(() => EmitCommand(document, component, command, commandSink)) { text = label }; - } - case "control.text": - case "control.input.text": - { - var label = component.GetProp("label", component.GetProp("title", "Value")); - var command = component.GetProp("command", component.GetProp("action", "set")); - var value = component.GetProp("value"); - var field = new TextField(label); - field.SetValueWithoutNotify(value); - field.RegisterValueChangedCallback(evt => - { - if (string.Equals(evt.newValue, value, StringComparison.Ordinal)) - return; - - var payload = new Dictionary(component.Props, StringComparer.Ordinal) - { - ["value"] = evt.newValue ?? "" - }; - EmitCommand(document, component, command, GameCult.Mesh.CultMesh.OperationPayload(payload), commandSink); - }); - return field; - } - default: - { - var element = new VisualElement(); - element.AddToClassList("eve-unknown"); - var title = component.GetProp("title", component.GetProp("label")); - if (!string.IsNullOrWhiteSpace(title)) - element.Add(BodyLabel(title)); - return element; - } - } - } - - private static void EmitCommand( - EveSurfaceDocument document, - EveSurfaceComponent component, - string command, - Action? commandSink) - { - EmitCommand( - document, - component, - command, - GameCult.Mesh.CultMesh.OperationPayload(component.Props), - commandSink); - } - - private static void EmitCommand( - EveSurfaceDocument document, - EveSurfaceComponent component, - string command, - GameCult.Mesh.CultMeshOperationPayload payload, - Action? commandSink) - { - if (commandSink == null || string.IsNullOrWhiteSpace(command)) - return; - - commandSink(new EveSurfaceCommandRequest( - document.ProviderId, - document.Surface.Id, - ResolveOperation(document, command), - payload, - DateTimeOffset.UtcNow, - "unity-uitoolkit")); - } - - private static GameCult.Mesh.CultMeshOperationInvocationDescriptor ResolveOperation( - EveSurfaceDocument document, - string command) - { - foreach (var template in document.Commands) - { - if (string.Equals(template.Command, command, StringComparison.Ordinal)) - return GameCult.Mesh.CultMesh.OperationInvocation(template.Operation); - } - - return GameCult.Mesh.CultMesh.OperationInvocation(command); - } - - private static Label TitleLabel(string text) - { - var label = new Label(text); - label.AddToClassList("eve-title"); - label.style.unityFontStyleAndWeight = FontStyle.Bold; - return label; - } - - private static Label BodyLabel(string text) - { - var label = new Label(text); - label.AddToClassList("eve-text"); - return label; - } - - private static Label MutedLabel(string text) - { - var label = new Label(text); - label.AddToClassList("eve-muted"); - return label; - } - - private static Label ValueLabel(string text) - { - var label = new Label(text); - label.AddToClassList("eve-value"); - label.style.unityFontStyleAndWeight = FontStyle.Bold; - return label; - } - - private static VisualElement FieldLabel(string key, string value) - { - var field = new VisualElement(); - field.AddToClassList("eve-field"); - field.style.flexDirection = FlexDirection.Row; - field.Add(MutedLabel(key)); - field.Add(BodyLabel(value)); - return field; - } - - private static void ApplyStyleTokens(VisualElement root, IReadOnlyList tokens) - { - foreach (var token in tokens) - { - if (string.IsNullOrWhiteSpace(token.Name) || string.IsNullOrWhiteSpace(token.Value)) - continue; - - root.AddToClassList($"eve-style-token-{SafeClass(token.Name)}"); - } - } - - private static void ApplyGeneratedLayout(VisualElement element, EveSurfaceComponent component) - { - var layout = component.Layout ?? new Dictionary(StringComparer.Ordinal); - var style = component.Style ?? new Dictionary(StringComparer.Ordinal); - - if (TryGet(layout, "display", out var display)) - element.style.display = string.Equals(display, "none", StringComparison.OrdinalIgnoreCase) - ? DisplayStyle.None - : DisplayStyle.Flex; - if (TryGet(layout, "direction", out var direction)) - { - if (string.Equals(direction, "horizontal", StringComparison.OrdinalIgnoreCase) || - string.Equals(direction, "row", StringComparison.OrdinalIgnoreCase)) - element.style.flexDirection = FlexDirection.Row; - else if (string.Equals(direction, "vertical", StringComparison.OrdinalIgnoreCase) || - string.Equals(direction, "column", StringComparison.OrdinalIgnoreCase)) - element.style.flexDirection = FlexDirection.Column; - } - if (TryGet(layout, "flexWrap", out var flexWrap)) - element.style.flexWrap = string.Equals(flexWrap, "wrap", StringComparison.OrdinalIgnoreCase) ? Wrap.Wrap : Wrap.NoWrap; - if (TryGet(layout, "alignItems", out var alignItems) && TryParseAlign(alignItems, out var align)) - element.style.alignItems = align; - if (TryGet(layout, "justifyContent", out var justifyContent) && TryParseJustify(justifyContent, out var justify)) - element.style.justifyContent = justify; - if (TryGet(layout, "width", out var width)) - element.style.width = ParseLength(width); - if (TryGet(layout, "minWidth", out var minWidth)) - element.style.minWidth = ParseLength(minWidth); - if (TryGet(layout, "maxWidth", out var maxWidth)) - element.style.maxWidth = ParseLength(maxWidth); - if (TryGet(layout, "height", out var height)) - element.style.height = ParseLength(height); - if (TryGet(layout, "minHeight", out var minHeight)) - element.style.minHeight = ParseLength(minHeight); - if (TryGet(layout, "maxHeight", out var maxHeight)) - element.style.maxHeight = ParseLength(maxHeight); - if (TryGet(layout, "padding", out var padding)) - ApplyBoxLength(padding, value => - { - element.style.paddingTop = value; - element.style.paddingRight = value; - element.style.paddingBottom = value; - element.style.paddingLeft = value; - }); - if (TryGet(layout, "margin", out var margin)) - ApplyBoxLength(margin, value => - { - element.style.marginTop = value; - element.style.marginRight = value; - element.style.marginBottom = value; - element.style.marginLeft = value; - }); - if (TryGet(layout, "overflow", out var overflow)) - element.style.overflow = string.Equals(overflow, "hidden", StringComparison.OrdinalIgnoreCase) - ? Overflow.Hidden - : Overflow.Visible; - - if (TryGet(style, "background", out var background) && TryParseColor(background, out var backgroundColor)) - element.style.backgroundColor = backgroundColor; - if (TryGet(style, "color", out var color) && TryParseColor(color, out var textColor)) - element.style.color = textColor; - if (TryGet(style, "borderWidth", out var borderWidth)) - ApplyBoxFloat(borderWidth, value => - { - element.style.borderTopWidth = value; - element.style.borderRightWidth = value; - element.style.borderBottomWidth = value; - element.style.borderLeftWidth = value; - }); - if (TryGet(style, "borderColor", out var borderColor) && TryParseColor(borderColor, out var border)) - { - element.style.borderTopColor = border; - element.style.borderRightColor = border; - element.style.borderBottomColor = border; - element.style.borderLeftColor = border; - } - if (TryGet(style, "borderRadius", out var borderRadius)) - ApplyBoxLength(borderRadius, value => - { - element.style.borderTopLeftRadius = value; - element.style.borderTopRightRadius = value; - element.style.borderBottomRightRadius = value; - element.style.borderBottomLeftRadius = value; - }); - if (TryGet(style, "fontSize", out var fontSize)) - element.style.fontSize = ParseLength(fontSize); - if (TryGet(style, "fontWeight", out var fontWeight) && - (string.Equals(fontWeight, "bold", StringComparison.OrdinalIgnoreCase) || fontWeight == "700")) - element.style.unityFontStyleAndWeight = FontStyle.Bold; - } - - private static bool TryGet(IReadOnlyDictionary values, string key, out string value) - { - if (values.TryGetValue(key, out value) && !string.IsNullOrWhiteSpace(value)) - return true; - - value = ""; - return false; - } - - private static StyleLength ParseLength(string value) - { - value = FirstToken(value); - if (string.Equals(value, "auto", StringComparison.OrdinalIgnoreCase)) - return StyleKeyword.Auto; - if (value.EndsWith("%", StringComparison.Ordinal) && - float.TryParse(value.Substring(0, value.Length - 1), NumberStyles.Float, CultureInfo.InvariantCulture, out var percent)) - return new Length(percent, LengthUnit.Percent); - if (value.EndsWith("px", StringComparison.OrdinalIgnoreCase)) - value = value.Substring(0, value.Length - 2); - if (float.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out var pixels)) - return new Length(pixels, LengthUnit.Pixel); - - return StyleKeyword.Null; - } - - private static StyleFloat ParseFloat(string value) - { - value = FirstToken(value); - if (value.EndsWith("px", StringComparison.OrdinalIgnoreCase)) - value = value.Substring(0, value.Length - 2); - return float.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out var pixels) - ? pixels - : StyleKeyword.Null; - } - - private static void ApplyBoxLength(string value, Action apply) - { - apply(ParseLength(value)); - } - - private static void ApplyBoxFloat(string value, Action apply) - { - apply(ParseFloat(value)); - } - - private static bool TryParseColor(string value, out Color color) - { - value = value.Trim(); - if (value.StartsWith("var(", StringComparison.Ordinal)) - { - color = default; - return false; - } - return ColorUtility.TryParseHtmlString(value, out color); - } - - private static bool TryParseAlign(string value, out Align align) - { - switch (value) - { - case "center": - align = Align.Center; - return true; - case "end": - case "flex-end": - align = Align.FlexEnd; - return true; - case "stretch": - align = Align.Stretch; - return true; - case "start": - case "flex-start": - align = Align.FlexStart; - return true; - default: - align = Align.Auto; - return false; - } - } - - private static bool TryParseJustify(string value, out Justify justify) - { - switch (value) - { - case "center": - justify = Justify.Center; - return true; - case "end": - case "flex-end": - justify = Justify.FlexEnd; - return true; - case "space-between": - justify = Justify.SpaceBetween; - return true; - case "space-around": - justify = Justify.SpaceAround; - return true; - case "start": - case "flex-start": - justify = Justify.FlexStart; - return true; - default: - justify = Justify.FlexStart; - return false; - } - } - - private static string FirstToken(string value) - { - return (value ?? "").Trim().Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault() ?? ""; - } - - private static string NormalizeKind(string kind) - { - if (string.IsNullOrWhiteSpace(kind)) - return ""; - - if (kind == "panel.dialogue") - return "panel"; - if (kind.StartsWith("text.", StringComparison.Ordinal)) - return "text"; - if (kind.StartsWith("control.button.", StringComparison.Ordinal)) - return "control.button"; - if (kind.StartsWith("control.text.", StringComparison.Ordinal)) - return "control.text"; - - return kind; - } - - private static string SafeName(string value) - { - return string.IsNullOrWhiteSpace(value) ? "eve.component" : value; - } - - private static string SafeClass(string value) - { - if (string.IsNullOrWhiteSpace(value)) - return "unknown"; - - var characters = value.ToCharArray(); - for (var index = 0; index < characters.Length; index++) - { - if (!char.IsLetterOrDigit(characters[index])) - characters[index] = '-'; - } - - return new string(characters).Trim('-').ToLowerInvariant(); - } - } -} diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceLowerer.cs.meta b/packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceLowerer.cs.meta deleted file mode 100644 index ab8e870..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceLowerer.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: bef5882c69652c54fb26b07d63e5bcdd \ No newline at end of file diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceOptions.cs b/packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceOptions.cs deleted file mode 100644 index b58ae10..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceOptions.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using GameCult.Eve.Surface; - -#nullable enable - -namespace GameCult.Eve.UnityUIToolkit -{ - public sealed class EveUiToolkitSurfaceOptions - { - public static EveUiToolkitSurfaceOptions Default { get; } = new EveUiToolkitSurfaceOptions(); - - public EveUiToolkitSurfaceOptions( - Func? embeddedDocumentResolver = null, - IReadOnlyList? pluginProjectionAdapters = null) - { - EmbeddedDocumentResolver = embeddedDocumentResolver; - PluginProjectionAdapters = pluginProjectionAdapters ?? new IEveUiToolkitPluginProjectionAdapter[] - { - new SaiVisualNovelUiToolkitProjectionAdapter(), - new NornGraphUiToolkitProjectionAdapter(), - new TeXMathUiToolkitProjectionAdapter() - }; - } - - public Func? EmbeddedDocumentResolver { get; } - - public IReadOnlyList PluginProjectionAdapters { get; } - - public IEveUiToolkitPluginProjectionAdapter? FindPluginProjectionAdapter(EveSurfaceComponent component) - { - return PluginProjectionAdapters.FirstOrDefault(adapter => adapter.CanLower(component)); - } - } -} diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceOptions.cs.meta b/packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceOptions.cs.meta deleted file mode 100644 index a0208aa..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceOptions.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: e2fd027205cc9214eaa7dd84fe75d7bd \ No newline at end of file diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/GameCult.Eve.UnityUIToolkit.asmdef b/packages/org.gamecult.eve.unity-uitoolkit/Runtime/GameCult.Eve.UnityUIToolkit.asmdef deleted file mode 100644 index 9fc5a53..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/GameCult.Eve.UnityUIToolkit.asmdef +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "GameCult.Eve.UnityUIToolkit", - "rootNamespace": "GameCult.Eve.UnityUIToolkit", - "references": [ - "GameCult.Eve.Surface" - ], - "includePlatforms": [], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false -} diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/GameCult.Eve.UnityUIToolkit.asmdef.meta b/packages/org.gamecult.eve.unity-uitoolkit/Runtime/GameCult.Eve.UnityUIToolkit.asmdef.meta deleted file mode 100644 index e9be7c4..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/GameCult.Eve.UnityUIToolkit.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 093779c1124fb5241b9c16e18173520a -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/IEveUiToolkitPluginProjectionAdapter.cs b/packages/org.gamecult.eve.unity-uitoolkit/Runtime/IEveUiToolkitPluginProjectionAdapter.cs deleted file mode 100644 index 8e99b61..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/IEveUiToolkitPluginProjectionAdapter.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using GameCult.Eve.Surface; -using UnityEngine.UIElements; - -#nullable enable - -namespace GameCult.Eve.UnityUIToolkit -{ - public interface IEveUiToolkitPluginProjectionAdapter - { - string PluginId { get; } - - IReadOnlyList Capabilities { get; } - - bool CanLower(EveSurfaceComponent component); - - VisualElement Lower( - EveSurfaceComponent component, - EveSurfaceDocument document, - Action? commandSink); - } -} diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/IEveUiToolkitPluginProjectionAdapter.cs.meta b/packages/org.gamecult.eve.unity-uitoolkit/Runtime/IEveUiToolkitPluginProjectionAdapter.cs.meta deleted file mode 100644 index f8b26b7..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/IEveUiToolkitPluginProjectionAdapter.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 8e93b6d6e2364ef4a91766cbf5a44b62 diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/NornGraphUiToolkitProjectionAdapter.cs b/packages/org.gamecult.eve.unity-uitoolkit/Runtime/NornGraphUiToolkitProjectionAdapter.cs deleted file mode 100644 index d18d7cf..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/NornGraphUiToolkitProjectionAdapter.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using System.Collections.Generic; -using GameCult.Eve.Surface; -using GameCult.Mesh; -using UnityEngine; -using UnityEngine.UIElements; - -#nullable enable - -namespace GameCult.Eve.UnityUIToolkit -{ - public sealed class NornGraphUiToolkitProjectionAdapter : IEveUiToolkitPluginProjectionAdapter - { - public string PluginId => "norn.graph"; - - public IReadOnlyList Capabilities { get; } = new[] - { - "embed.norn" - }; - - public bool CanLower(EveSurfaceComponent component) - { - return string.Equals(component.Kind, "embed.norn", StringComparison.Ordinal); - } - - public VisualElement Lower( - EveSurfaceComponent component, - EveSurfaceDocument document, - Action? commandSink) - { - var graph = new VisualElement(); - graph.AddToClassList("eve-plugin-projection"); - graph.AddToClassList("eve-plugin-norn-graph"); - graph.AddToClassList("norn-graph"); - graph.style.flexDirection = FlexDirection.Column; - - var title = component.GetProp("label", component.GetProp("title", "Norn graph")); - var titleLabel = new Label(title); - titleLabel.AddToClassList("norn-graph-title"); - titleLabel.style.unityFontStyleAndWeight = FontStyle.Bold; - graph.Add(titleLabel); - - var mode = component.GetProp("mode", component.GetProp("layoutMode", "embedded")); - var modeLabel = new Label(mode); - modeLabel.AddToClassList("norn-graph-mode"); - graph.Add(modeLabel); - - var focusCommand = component.GetProp("command", component.GetProp("focusCommand", "graph.focus")); - graph.RegisterCallback(_ => EmitGraphCommand(document, component, focusCommand, commandSink)); - - return graph; - } - - private static void EmitGraphCommand( - EveSurfaceDocument document, - EveSurfaceComponent component, - string command, - Action? commandSink) - { - if (commandSink == null || string.IsNullOrWhiteSpace(command)) - return; - - commandSink(new EveSurfaceCommandRequest( - document.ProviderId, - document.Surface.Id, - ResolveOperation(document, command), - CultMesh.OperationPayload(component.Props), - DateTimeOffset.UtcNow, - "unity-uitoolkit")); - } - - private static CultMeshOperationInvocationDescriptor ResolveOperation( - EveSurfaceDocument document, - string command) - { - foreach (var template in document.Commands) - { - if (string.Equals(template.Command, command, StringComparison.Ordinal)) - return CultMesh.OperationInvocation(template.Operation); - } - - return CultMesh.OperationInvocation(command); - } - } -} diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/NornGraphUiToolkitProjectionAdapter.cs.meta b/packages/org.gamecult.eve.unity-uitoolkit/Runtime/NornGraphUiToolkitProjectionAdapter.cs.meta deleted file mode 100644 index 07345b2..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/NornGraphUiToolkitProjectionAdapter.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 729936c97f3c45f7bba0fcd6de8b40f5 diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/SaiVisualNovelUiToolkitProjectionAdapter.cs b/packages/org.gamecult.eve.unity-uitoolkit/Runtime/SaiVisualNovelUiToolkitProjectionAdapter.cs deleted file mode 100644 index 9bf0c19..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/SaiVisualNovelUiToolkitProjectionAdapter.cs +++ /dev/null @@ -1,205 +0,0 @@ -using System; -using System.Collections.Generic; -using GameCult.Eve.Surface; -using GameCult.Mesh; -using UnityEngine; -using UnityEngine.UIElements; - -#nullable enable - -namespace GameCult.Eve.UnityUIToolkit -{ - public sealed class SaiVisualNovelUiToolkitProjectionAdapter : IEveUiToolkitPluginProjectionAdapter - { - public string PluginId => "sai.vn"; - - public IReadOnlyList Capabilities { get; } = new[] - { - "vn.stage", - "story.choose", - "story.continue", - "story.jump" - }; - - public bool CanLower(EveSurfaceComponent component) - { - switch (component.Kind) - { - case "vn.stage": - case "panel.dialogue": - case "text.dialogue": - case "rail.actions": - return true; - case "control.button": - return IsStoryCommand(component); - default: - return false; - } - } - - public VisualElement Lower( - EveSurfaceComponent component, - EveSurfaceDocument document, - Action? commandSink) - { - switch (component.Kind) - { - case "vn.stage": - return Stage(component); - case "panel.dialogue": - return DialoguePanel(component); - case "text.dialogue": - return DialogueText(component); - case "rail.actions": - return ActionRail(); - case "control.button": - return StoryButton(component, document, commandSink); - default: - return new VisualElement(); - } - } - - private static VisualElement Stage(EveSurfaceComponent component) - { - var stage = new VisualElement(); - stage.AddToClassList("eve-plugin-projection"); - stage.AddToClassList("eve-plugin-sai-vn"); - stage.AddToClassList("sai-vn-stage"); - stage.style.flexGrow = 1; - stage.style.flexDirection = FlexDirection.Column; - - var storyId = component.GetProp("storyId"); - var currentPath = component.GetProp("currentPath"); - if (!string.IsNullOrWhiteSpace(storyId) || !string.IsNullOrWhiteSpace(currentPath)) - { - var state = new Label(string.IsNullOrWhiteSpace(currentPath) - ? storyId - : $"{storyId}:{currentPath}"); - state.AddToClassList("sai-vn-state"); - state.style.unityFontStyleAndWeight = FontStyle.Bold; - stage.Add(state); - } - - return stage; - } - - private static VisualElement DialoguePanel(EveSurfaceComponent component) - { - var panel = new VisualElement(); - panel.AddToClassList("eve-plugin-projection"); - panel.AddToClassList("eve-plugin-sai-vn"); - panel.AddToClassList("sai-vn-dialogue"); - panel.style.flexDirection = FlexDirection.Column; - - var speaker = component.GetProp("speaker"); - if (!string.IsNullOrWhiteSpace(speaker)) - { - var speakerLabel = new Label(speaker); - speakerLabel.AddToClassList("sai-vn-speaker"); - speakerLabel.style.unityFontStyleAndWeight = FontStyle.Bold; - panel.Add(speakerLabel); - } - - var scene = component.GetProp("scene"); - if (!string.IsNullOrWhiteSpace(scene)) - { - var sceneLabel = new Label(scene); - sceneLabel.AddToClassList("sai-vn-scene"); - panel.Add(sceneLabel); - } - - return panel; - } - - private static VisualElement DialogueText(EveSurfaceComponent component) - { - var text = new Label(component.GetProp("text")); - text.AddToClassList("eve-plugin-projection"); - text.AddToClassList("eve-plugin-sai-vn"); - text.AddToClassList("sai-vn-dialogue-text"); - return text; - } - - private static VisualElement ActionRail() - { - var rail = new VisualElement(); - rail.AddToClassList("eve-plugin-projection"); - rail.AddToClassList("eve-plugin-sai-vn"); - rail.AddToClassList("sai-vn-actions"); - rail.style.flexDirection = FlexDirection.Row; - rail.style.flexWrap = Wrap.Wrap; - return rail; - } - - private static Button StoryButton( - EveSurfaceComponent component, - EveSurfaceDocument document, - Action? commandSink) - { - var label = component.GetProp("label", component.GetProp("title", "Continue")); - var command = StoryCommand(component); - var button = new Button(() => EmitStoryCommand(document, component, command, commandSink)) { text = label }; - button.AddToClassList("eve-plugin-projection"); - button.AddToClassList("eve-plugin-sai-vn"); - button.AddToClassList("sai-vn-story-command"); - button.AddToClassList($"sai-vn-command-{SafeClass(command)}"); - return button; - } - - private static bool IsStoryCommand(EveSurfaceComponent component) - { - return StoryCommand(component).StartsWith("story.", StringComparison.Ordinal); - } - - private static string StoryCommand(EveSurfaceComponent component) - { - return component.GetProp("command", component.GetProp("action", component.GetProp("type"))); - } - - private static void EmitStoryCommand( - EveSurfaceDocument document, - EveSurfaceComponent component, - string command, - Action? commandSink) - { - if (commandSink == null || string.IsNullOrWhiteSpace(command)) - return; - - commandSink(new EveSurfaceCommandRequest( - document.ProviderId, - document.Surface.Id, - ResolveOperation(document, command), - CultMesh.OperationPayload(component.Props), - DateTimeOffset.UtcNow, - "unity-uitoolkit")); - } - - private static CultMeshOperationInvocationDescriptor ResolveOperation( - EveSurfaceDocument document, - string command) - { - foreach (var template in document.Commands) - { - if (string.Equals(template.Command, command, StringComparison.Ordinal)) - return CultMesh.OperationInvocation(template.Operation); - } - - return CultMesh.OperationInvocation(command); - } - - private static string SafeClass(string value) - { - if (string.IsNullOrWhiteSpace(value)) - return "unknown"; - - var characters = value.ToCharArray(); - for (var index = 0; index < characters.Length; index++) - { - if (!char.IsLetterOrDigit(characters[index])) - characters[index] = '-'; - } - - return new string(characters).Trim('-').ToLowerInvariant(); - } - } -} diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/SaiVisualNovelUiToolkitProjectionAdapter.cs.meta b/packages/org.gamecult.eve.unity-uitoolkit/Runtime/SaiVisualNovelUiToolkitProjectionAdapter.cs.meta deleted file mode 100644 index e87f0bd..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/SaiVisualNovelUiToolkitProjectionAdapter.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 4e8f6fc7d7ef4dd7b22ec33d4f81d321 diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/TeXMathUiToolkitProjectionAdapter.cs b/packages/org.gamecult.eve.unity-uitoolkit/Runtime/TeXMathUiToolkitProjectionAdapter.cs deleted file mode 100644 index 51ef3d0..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/TeXMathUiToolkitProjectionAdapter.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Collections.Generic; -using GameCult.Eve.Surface; -using UnityEngine.UIElements; - -#nullable enable - -namespace GameCult.Eve.UnityUIToolkit -{ - public sealed class TeXMathUiToolkitProjectionAdapter : IEveUiToolkitPluginProjectionAdapter - { - public string PluginId => "tex.math"; - - public IReadOnlyList Capabilities { get; } = new[] - { - "embed.tex", - "tex.inline", - "tex.block" - }; - - public bool CanLower(EveSurfaceComponent component) - { - return string.Equals(component.Kind, "embed.tex", StringComparison.Ordinal); - } - - public VisualElement Lower( - EveSurfaceComponent component, - EveSurfaceDocument document, - Action? commandSink) - { - var tex = new VisualElement(); - tex.AddToClassList("eve-plugin-projection"); - tex.AddToClassList("eve-plugin-tex-math"); - tex.AddToClassList("tex-math"); - tex.AddToClassList($"tex-display-{SafeClass(component.GetProp("display", "inline"))}"); - tex.style.flexDirection = FlexDirection.Column; - - var label = component.GetProp("label", "TeX"); - if (!string.IsNullOrWhiteSpace(label)) - { - var labelElement = new Label(label); - labelElement.AddToClassList("tex-math-label"); - tex.Add(labelElement); - } - - var source = component.GetProp("source", component.GetProp("sourceUri", "")); - var sourceElement = new Label(source); - sourceElement.AddToClassList("tex-math-source-fallback"); - tex.Add(sourceElement); - - return tex; - } - - private static string SafeClass(string value) - { - if (string.IsNullOrWhiteSpace(value)) - return "unknown"; - - var characters = value.ToCharArray(); - for (var index = 0; index < characters.Length; index++) - { - if (!char.IsLetterOrDigit(characters[index])) - characters[index] = '-'; - } - - return new string(characters).Trim('-').ToLowerInvariant(); - } - } -} diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/TeXMathUiToolkitProjectionAdapter.cs.meta b/packages/org.gamecult.eve.unity-uitoolkit/Runtime/TeXMathUiToolkitProjectionAdapter.cs.meta deleted file mode 100644 index 0bcd3dd..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Runtime/TeXMathUiToolkitProjectionAdapter.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: d6c655fae0c77064490eba9c3ed1fb4c \ No newline at end of file diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Tests.meta b/packages/org.gamecult.eve.unity-uitoolkit/Tests.meta deleted file mode 100644 index 0966739..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Tests.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 694b4921723a4d56a9f0f72ad2240feb -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor.meta b/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor.meta deleted file mode 100644 index 9ea2f73..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: acfcd889183e4bfbac82f8883deef300 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs b/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs deleted file mode 100644 index a9d88fb..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs +++ /dev/null @@ -1,144 +0,0 @@ -using System; -using System.Collections.Generic; -using GameCult.Eve.Surface; -using GameCult.Mesh; -using NUnit.Framework; -using UnityEngine.UIElements; - -#nullable enable - -namespace GameCult.Eve.UnityUIToolkit.Tests -{ - public sealed class EveUiToolkitSurfaceLowererTests - { - [Test] - public void DefaultOptionsExposeSaiNornAndTeXProjectionAdapters() - { - var options = EveUiToolkitSurfaceOptions.Default; - - Assert.That(options.FindPluginProjectionAdapter(Component("stage", "vn.stage"))?.PluginId, Is.EqualTo("sai.vn")); - Assert.That(options.FindPluginProjectionAdapter(Component("graph", "embed.norn"))?.PluginId, Is.EqualTo("norn.graph")); - Assert.That(options.FindPluginProjectionAdapter(Component("math", "embed.tex"))?.PluginId, Is.EqualTo("tex.math")); - } - - [Test] - public void SaiStageLowersThroughRuntimeProjectionAdapter() - { - var document = Document(Component( - "stage", - "vn.stage", - new Dictionary - { - ["storyId"] = "sai.fixture", - ["currentPath"] = "intro" - })); - - var root = new EveUiToolkitSurfaceLowerer().Lower(document); - - Assert.That(root.ClassListContains("eve-plugin-projection"), Is.True); - Assert.That(root.ClassListContains("eve-plugin-sai-vn"), Is.True); - Assert.That(root.ClassListContains("sai-vn-stage"), Is.True); - } - - [Test] - public void NornGraphLowersThroughRuntimeProjectionAdapter() - { - var document = Document(Component( - "graph", - "embed.norn", - new Dictionary - { - ["label"] = "World graph", - ["mode"] = "embedded" - })); - - var root = new EveUiToolkitSurfaceLowerer().Lower(document); - - Assert.That(root.ClassListContains("eve-plugin-projection"), Is.True); - Assert.That(root.ClassListContains("eve-plugin-norn-graph"), Is.True); - Assert.That(root.ClassListContains("norn-graph"), Is.True); - } - - [Test] - public void TeXMathLowersThroughRuntimeProjectionAdapterAsSourceFallback() - { - var document = Document(Component( - "math", - "embed.tex", - new Dictionary - { - ["label"] = "Bifrost voting weight", - ["source"] = "\\\\mathrm{votes}(p)=1+\\\\lfloor\\\\log_b(1+p)\\\\rfloor", - ["display"] = "block" - })); - - var root = new EveUiToolkitSurfaceLowerer().Lower(document); - - Assert.That(root.ClassListContains("eve-plugin-projection"), Is.True); - Assert.That(root.ClassListContains("eve-plugin-tex-math"), Is.True); - Assert.That(root.ClassListContains("tex-math"), Is.True); - Assert.That(root.ClassListContains("tex-display-block"), Is.True); - } - - [Test] - public void EmbeddedDocumentSlotMountsResolverBackedChildSurface() - { - var child = Document( - Component("child-root", "text", new Dictionary { ["text"] = "Nested surface" }), - surfaceId: "child-surface"); - var parentRoot = new EveSurfaceComponent( - "parent-root", - "surface", - EmptyProps(), - Array.Empty(), - Array.Empty(), - new[] - { - new EveEmbeddedDocumentSlot( - "child-slot", - "child-surface", - EveSurfaceDocument.SchemaId, - "inline") - }); - var lowerer = new EveUiToolkitSurfaceLowerer(new EveUiToolkitSurfaceOptions( - embeddedDocumentResolver: _ => child, - pluginProjectionAdapters: Array.Empty())); - - var root = lowerer.Lower(Document(parentRoot)); - var embedded = root.Query(className: "eve-embedded-document").First(); - - Assert.That(embedded, Is.Not.Null); - Assert.That(embedded.name, Is.EqualTo("child-slot")); - Assert.That(embedded.ClassListContains("eve-embedded-kind-inline"), Is.True); - } - - private static EveSurfaceDocument Document(EveSurfaceComponent root, string surfaceId = "test-surface") - { - return new EveSurfaceDocument( - "gamecult.eve.unity.tests", - "runtime.test", - "Unity UI Toolkit tests", - 1, - "2026-07-08T00:00:00Z", - new EveSurfaceTree(surfaceId, root, Array.Empty()), - Array.Empty()); - } - - private static EveSurfaceComponent Component( - string id, - string kind, - IReadOnlyDictionary? props = null) - { - return new EveSurfaceComponent( - id, - kind, - props ?? EmptyProps(), - Array.Empty()); - } - - private static IReadOnlyDictionary EmptyProps() - { - return new Dictionary(StringComparer.Ordinal); - } - } -} diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs.meta b/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs.meta deleted file mode 100644 index c6725d8..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 2921e30d39fe49098bc3763c538ed67c diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef b/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef deleted file mode 100644 index 380920e..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "GameCult.Eve.UnityUIToolkit.Tests", - "rootNamespace": "GameCult.Eve.UnityUIToolkit.Tests", - "references": [ - "GameCult.Eve.UnityUIToolkit", - "GameCult.Eve.Surface", - "GameCult.Mesh" - ], - "includePlatforms": [ - "Editor" - ], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": true, - "precompiledReferences": [ - "GameCult.Caching.dll", - "GameCult.Mesh.dll", - "MessagePack.Annotations.dll" - ], - "autoReferenced": false, - "defineConstraints": [], - "versionDefines": [], - "optionalUnityReferences": [ - "TestAssemblies" - ], - "noEngineReferences": false -} diff --git a/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef.meta b/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef.meta deleted file mode 100644 index e9af2a3..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 353e1aea044b46ac98835959a19fe0ac -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json b/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json deleted file mode 100644 index b9ae1f4..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json +++ /dev/null @@ -1,252 +0,0 @@ -{ - "schema": "gamecult.eve.runtime_capability.v1", - "runtimeId": "unity-uitoolkit", - "title": "Unity / UI Toolkit", - "owner": "EveUnity", - "incubation": { - "ownerRepo": "EveUnity", - "currentHostRepo": "Eve", - "splitTarget": "EveUnity", - "graduationTrigger": "Split when Unity package has independent UPM release, plugin projection adapter behavior, and Unity test/capture lifecycle.", - "splitHandoff": { - "manifestPath": "packages/org.gamecult.eve.unity-uitoolkit/eveunity-split-handoff.json", - "smokeCommand": "powershell -ExecutionPolicy Bypass -File .\\scripts\\run-eveunity-split-handoff-smoke.ps1" - } - }, - "supportedFeatures": [ - "embeddedDocuments" - ], - "supportedPlugins": [ - { - "pluginId": "sai.vn", - "capabilities": [ - "vn.stage", - "story.choose", - "story.continue", - "story.jump" - ], - "projectionAdapter": "SaiVisualNovelUiToolkitProjectionAdapter" - }, - { - "pluginId": "norn.graph", - "capabilities": [ - "embed.norn" - ], - "projectionAdapter": "NornGraphUiToolkitProjectionAdapter" - }, - { - "pluginId": "tex.math", - "capabilities": [ - "embed.tex", - "tex.inline", - "tex.block" - ], - "projectionAdapter": "TeXMathUiToolkitProjectionAdapter" - } - ], - "unsupportedPlugins": [], - "commandTransport": { - "schema": "gamecult.eve.command_invocation.v1", - "emitter": "EveUiToolkitSurfaceLowerer.EmitCommand", - "clientId": "unity-uitoolkit" - }, - "worldSurfaceLowering": [ - { - "targetId": "unity-uitoolkit", - "surfaceKinds": ["interactive-world", "interactive-world-editor"], - "projectionKinds": ["provider-authored-world-surface", "provider-authored-world-editor-surface"], - "supportLevel": "ui-toolkit-semantic-command-surface", - "ownership": "runtime-lowers-provider-world-surface-without-owning-world-state", - "evidencePaths": [ - "packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceLowerer.cs", - "packages/org.gamecult.eve.unity-uitoolkit/Runtime/TeXMathUiToolkitProjectionAdapter.cs", - "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs", - "web/fixtures/aetheria.provider-advertisement.json", - "web/fixtures/eve-world-smoke.provider-advertisement.json" - ] - } - ], - "lifecycle": { - "release": { - "ownerRepo": "EveUnity", - "status": "upm-package-artifact-smoke", - "packageName": "org.gamecult.eve.unity-uitoolkit", - "packageManifest": "packages/org.gamecult.eve.unity-uitoolkit/package.json", - "releaseContract": { - "ownerRepo": "EveUnity", - "packageName": "org.gamecult.eve.unity-uitoolkit", - "packageRoot": "packages/org.gamecult.eve.unity-uitoolkit", - "versionSource": "packages/org.gamecult.eve.unity-uitoolkit/package.json", - "tagPattern": "eveunity-uitoolkit-v{version}", - "artifactKind": "upm-package", - "requestSchema": "gamecult.eve.runtime_release_request.v1", - "requestBuilder": "tools/eveunity/eveunity-release-contract.mjs", - "artifactBuilder": "tools/eveunity/eveunity-release-artifact.mjs", - "artifactPattern": "artifacts/eveunity-uitoolkit-release/{version}/org.gamecult.eve.unity-uitoolkit-{version}.tgz", - "publishProof": "Tagged UPM release is created from the EveUnity repo and references this package root.", - "requiredPackageDependencies": [ - { - "packageName": "org.gamecult.eve.surface", - "version": "0.1.0", - "packageManager": "upm", - "ownerRepo": "Eve", - "purpose": "Shared Unity DTOs for gamecult.eve.surface.v1 documents." - } - ] - }, - "evidencePaths": [ - "packages/org.gamecult.eve.unity-uitoolkit/package.json", - "packages/org.gamecult.eve.unity-uitoolkit/README.md", - "tools/eveunity/eveunity-release-contract.mjs", - "tools/eveunity/eveunity-release-contract.test.mjs", - "tools/eveunity/eveunity-release-artifact.mjs", - "tools/eveunity/eveunity-release-artifact.test.mjs", - "scripts/run-eveunity-release-contract-smoke.ps1", - "scripts/run-eveunity-release-artifact-smoke.ps1", - "scripts/run-aetheria-unity-package-smoke.ps1" - ], - "pendingProofs": [ - "Tagged UPM release cut from EveUnity rather than Eve incubation." - ] - }, - "test": { - "ownerRepo": "EveUnity", - "status": "batchmode-editmode-tests-and-consumer-build-smoke", - "command": "powershell -ExecutionPolicy Bypass -File .\\scripts\\run-aetheria-unity-editmode-tests.ps1", - "testContract": { - "ownerRepo": "EveUnity", - "runnerKind": "unity-editmode-batchmode", - "runnerScript": "scripts/run-aetheria-unity-editmode-tests.ps1", - "consumerProject": "E:\\Projects\\Aetheria", - "unityExeDefault": "C:\\Program Files\\Unity\\Hub\\Editor\\6000.4.2f1\\Editor\\Unity.exe", - "packageName": "org.gamecult.eve.unity-uitoolkit", - "testAssembly": "GameCult.Eve.UnityUIToolkit.Tests", - "testPlatform": "EditMode", - "resultsArtifact": "artifacts/aetheria-unity-editmode/{stamp}/unity-editmode-results.xml", - "logArtifact": "artifacts/aetheria-unity-editmode/{stamp}/unity-editmode.log", - "manifestMutation": "Temporarily adds org.gamecult.eve.unity-uitoolkit to Aetheria Packages/manifest.json testables and restores the manifest after the run.", - "managedAssemblyDependencies": [ - { - "assemblyName": "GameCult.Caching.dll", - "packageId": "GameCult.Caching", - "packageManager": "nuget", - "ownerRepo": "CultLib", - "resolutionMode": "Unity precompiled reference during EveUnity incubation.", - "dependencyContract": { - "sourceAuthority": "CultLib", - "packageSource": "nuget", - "packageId": "GameCult.Caching", - "assemblyName": "GameCult.Caching.dll", - "versionPolicy": "CultLib-owned package version stream.", - "unityResolution": "EveUnity consumes this as a Unity precompiled reference during incubation.", - "handoffRequirement": "EveUnity split must resolve this through CultLib's NuGet/package feed or a documented Unity import without vendoring CultLib ownership into Eve." - } - }, - { - "assemblyName": "GameCult.Mesh.dll", - "packageId": "GameCult.Mesh", - "packageManager": "nuget", - "ownerRepo": "CultLib", - "resolutionMode": "Unity precompiled reference during EveUnity incubation.", - "dependencyContract": { - "sourceAuthority": "CultLib", - "packageSource": "nuget", - "packageId": "GameCult.Mesh", - "assemblyName": "GameCult.Mesh.dll", - "versionPolicy": "CultLib-owned package version stream.", - "unityResolution": "EveUnity consumes this as a Unity precompiled reference during incubation.", - "handoffRequirement": "EveUnity split must resolve this through CultLib's NuGet/package feed or a documented Unity import without vendoring CultLib ownership into Eve." - } - }, - { - "assemblyName": "MessagePack.Annotations.dll", - "packageId": "MessagePack.Annotations", - "packageManager": "nuget", - "ownerRepo": "CultLib", - "resolutionMode": "Unity precompiled reference during EveUnity incubation.", - "dependencyContract": { - "sourceAuthority": "CultLib", - "packageSource": "nuget", - "packageId": "MessagePack.Annotations", - "assemblyName": "MessagePack.Annotations.dll", - "versionPolicy": "CultLib-owned transitive package version stream.", - "unityResolution": "EveUnity consumes this as a Unity precompiled reference during incubation.", - "handoffRequirement": "EveUnity split must resolve this through CultLib's NuGet/package feed or a documented Unity import without vendoring CultLib ownership into Eve." - } - } - ] - }, - "evidencePaths": [ - "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef", - "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs", - "scripts/run-aetheria-unity-editmode-tests.ps1", - "scripts/run-aetheria-unity-package-smoke.ps1", - "scripts/run-eveunity-split-handoff-smoke.ps1", - "packages/org.gamecult.eve.unity-uitoolkit/eveunity-split-handoff.json" - ], - "pendingProofs": [ - "Unity batchmode EditMode runner is owned by EveUnity rather than Eve incubation." - ] - }, - "capture": { - "ownerRepo": "EveUnity", - "status": "pending-editor-capture", - "captureContract": { - "ownerRepo": "EveUnity", - "runtimeId": "unity-uitoolkit", - "targetId": "unity-uitoolkit", - "requestSchema": "gamecult.eve.runtime_capture_request.v1", - "requestBuilder": "tools/eveunity/eveunity-capture-contract.mjs", - "advertisementPath": "web/fixtures/aetheria.provider-advertisement.json", - "captureKind": "unity-editor-or-batchmode-png", - "artifactKind": "png", - "artifactPattern": "artifacts/eveunity-uitoolkit-capture/{stamp}/unity-uitoolkit.png", - "conformanceAttachment": "runtime.captureArtifacts[]", - "requiredProvider": "aetheria", - "requiredSurface": "aetheria.daemon.game", - "additionalProviderSurfaces": [ - { - "providerId": "eve.world-smoke", - "surfaceId": "eve.world-smoke.surface", - "purpose": "Generic non-product interactive-world capture control." - }, - { - "providerId": "aetheria", - "surfaceId": "aetheria.daemon.editor", - "purpose": "Aetheria interactive-world-editor capture control." - } - ], - "authority": "Capture observes runtime projection only; provider state, command acceptance, and receipts stay provider-owned.", - "publishProof": "Unity editor or batchmode capture artifact is attached to the runtime conformance report from EveUnity." - }, - "evidencePaths": [ - "tools/eveunity/eveunity-capture-contract.mjs", - "tools/eveunity/eveunity-capture-contract.test.mjs", - "scripts/run-eveunity-capture-contract-smoke.ps1", - "tools/eveunity/eveunity-uitoolkit-capture-artifact.mjs", - "tools/eveunity/eveunity-uitoolkit-capture-artifact.test.mjs", - "scripts/run-eveunity-uitoolkit-capture-smoke.ps1", - "web/fixtures/aetheria.provider-advertisement.json" - ], - "pendingProofs": [ - "Unity batchmode or editor capture artifact attached to the runtime conformance report." - ] - } - }, - "capture": { - "status": "json-projection", - "note": "Unity UI Toolkit attaches a provider-advertisement-backed gamecult.eve.unity_uitoolkit_projection.v1 JSON projection artifact; Unity editor or batchmode PNG capture remains an EveUnity split blocker.", - "artifacts": [ - { - "kind": "json-projection", - "schema": "gamecult.eve.unity_uitoolkit_projection.v1", - "path": "artifacts/eveunity-uitoolkit-capture/latest/unity-uitoolkit-projection.json", - "runtimeId": "unity-uitoolkit", - "providerId": "aetheria", - "surfaceId": "aetheria.daemon.game", - "sourceSurfacePath": "web/fixtures/aetheria-world-surface.json", - "requestPath": "artifacts/eveunity-uitoolkit-capture/latest/capture-request.json" - } - ] - } -} diff --git a/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json.meta b/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json.meta deleted file mode 100644 index 0dd0209..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: c3f7a6e51d3f4bbd8d892922299df744 diff --git a/packages/org.gamecult.eve.unity-uitoolkit/eveunity-split-handoff.json b/packages/org.gamecult.eve.unity-uitoolkit/eveunity-split-handoff.json deleted file mode 100644 index 0620e43..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/eveunity-split-handoff.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "schema": "gamecult.eve.runtime_split_handoff.v1", - "splitTarget": "EveUnity", - "ownerRepo": "EveUnity", - "currentHostRepo": "Eve", - "runtimeId": "unity-uitoolkit", - "packageName": "org.gamecult.eve.unity-uitoolkit", - "sourcePackageRoot": "packages/org.gamecult.eve.unity-uitoolkit", - "destinationPackageRoot": "packages/org.gamecult.eve.unity-uitoolkit", - "authorityBoundary": "EveUnity owns native Unity projection, UPM package lifecycle, Unity test runners, Unity capture, and projection adapters for advertised plugin capabilities. Eve keeps the surface, command, provider advertisement, plugin advertisement, and conformance contracts. Provider Unity projects such as Aetheria consume EveUnity through those contracts while keeping product state, assets, scenes, generated project files, and daemon clients in the provider repo.", - "moveSets": [ - { - "id": "upm-package", - "stage": "release", - "currentPaths": [ - "packages/org.gamecult.eve.unity-uitoolkit/package.json", - "packages/org.gamecult.eve.unity-uitoolkit/README.md", - "packages/org.gamecult.eve.unity-uitoolkit/Runtime", - "packages/org.gamecult.eve.unity-uitoolkit/Tests", - "tools/eveunity/eveunity-release-contract.mjs", - "tools/eveunity/eveunity-release-contract.test.mjs", - "tools/eveunity/eveunity-release-artifact.mjs", - "tools/eveunity/eveunity-release-artifact.test.mjs", - "scripts/run-eveunity-release-contract-smoke.ps1", - "scripts/run-eveunity-release-artifact-smoke.ps1" - ], - "destinationOwner": "EveUnity", - "replacementProof": "Tagged UPM release cut from EveUnity rather than Eve incubation." - }, - { - "id": "unity-test-lifecycle", - "stage": "test", - "currentPaths": [ - "scripts/run-eveunity-lifecycle-smoke.ps1", - "scripts/run-aetheria-unity-package-smoke.ps1", - "scripts/run-aetheria-unity-editmode-tests.ps1", - "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef", - "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs" - ], - "destinationOwner": "EveUnity", - "replacementProof": "Unity batchmode EditMode runner is owned by EveUnity rather than Eve incubation." - }, - { - "id": "unity-capture-lifecycle", - "stage": "capture", - "currentPaths": [ - "tools/eveunity/eveunity-capture-contract.mjs", - "tools/eveunity/eveunity-capture-contract.test.mjs", - "scripts/run-eveunity-capture-contract-smoke.ps1", - "tools/eveunity/eveunity-uitoolkit-capture-artifact.mjs", - "tools/eveunity/eveunity-uitoolkit-capture-artifact.test.mjs", - "scripts/run-eveunity-uitoolkit-capture-smoke.ps1" - ], - "destinationOwner": "EveUnity", - "replacementProof": "Unity batchmode or editor capture artifact attached to the runtime conformance report." - }, - { - "id": "aetheria-unity-consumer-boundary", - "stage": "provider-consumer", - "currentPaths": [ - "scripts/run-aetheria-unity-package-smoke.ps1", - "scripts/run-aetheria-unity-editmode-tests.ps1" - ], - "observedProviderPaths": [ - "E:\\Projects\\Aetheria\\Packages\\manifest.json", - "E:\\Projects\\Aetheria\\GameCult.Eve.UnityUIToolkit.csproj", - "E:\\Projects\\Aetheria\\Assets", - "E:\\Projects\\Aetheria\\Aetheria.State.Unity\\AetheriaRuntimeCatalogClient.cs", - "E:\\Projects\\Aetheria\\Aetheria.State.Unity.Smoke\\Program.cs" - ], - "destinationOwner": "EveUnity", - "replacementProof": "Aetheria consumes EveUnity through package and conformance contracts while keeping Unity product project files, generated projects, assets, scenes, daemon catalog clients, and provider receipts in Aetheria." - } - ], - "contractInputs": [ - "gamecult.eve.surface.v1", - "gamecult.eve.command.v1", - "gamecult.eve.command_invocation.v1", - "gamecult.eve.provider_advertisement.v1", - "gamecult.eve.plugin_advertisement.v1", - "gamecult.eve.plugin.v1", - "gamecult.eve.conformance_export.v1" - ], - "forbiddenImports": [ - "provider internals", - "plugin semantic internals", - "Aetheria daemon state as Unity package authority", - "Sai, Norn, or TeX implementation state as Unity projection authority" - ], - "requiredExternalProofs": [ - "EveUnity publishes a tagged UPM release.", - "EveUnity owns the Unity batchmode EditMode runner.", - "EveUnity attaches Unity editor or batchmode capture artifacts to conformance output.", - "Aetheria consumes EveUnity through the package contract without importing Eve source layout.", - "Aetheria Unity product paths remain provider-owned observed-provider evidence, not EveUnity source authority." - ] -} diff --git a/packages/org.gamecult.eve.unity-uitoolkit/eveunity-split-handoff.json.meta b/packages/org.gamecult.eve.unity-uitoolkit/eveunity-split-handoff.json.meta deleted file mode 100644 index 442eefb..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/eveunity-split-handoff.json.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: d50f4f5a379d8ab4ba6217c2af18ded0 -TextScriptImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/packages/org.gamecult.eve.unity-uitoolkit/package.json b/packages/org.gamecult.eve.unity-uitoolkit/package.json deleted file mode 100644 index cf91087..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "org.gamecult.eve.unity-uitoolkit", - "displayName": "Eve UI Toolkit Lowering", - "version": "0.1.0", - "unity": "2021.3", - "description": "Unity UI Toolkit lowering for gamecult.eve.surface.v1 documents.", - "dependencies": { - "org.gamecult.eve.surface": "0.1.0" - }, - "keywords": [ - "Eve", - "CultUI", - "UI Toolkit", - "Unity" - ], - "license": "MPL-2.0", - "category": "Scripting" -} diff --git a/packages/org.gamecult.eve.unity-uitoolkit/package.json.meta b/packages/org.gamecult.eve.unity-uitoolkit/package.json.meta deleted file mode 100644 index 5f395fc..0000000 --- a/packages/org.gamecult.eve.unity-uitoolkit/package.json.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 6c6c93dde27b8dc42bf3866cd5c6c3cb -PackageManifestImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/scripts/run-aetheria-conformance-consumer-smoke.ps1 b/scripts/run-aetheria-conformance-consumer-smoke.ps1 index 157ac6d..7f80703 100644 --- a/scripts/run-aetheria-conformance-consumer-smoke.ps1 +++ b/scripts/run-aetheria-conformance-consumer-smoke.ps1 @@ -81,7 +81,6 @@ try { --expect-command-boundary-coverage aetheria:aetheria.daemon.editor:electron-shell:covered:EveElectron:electron-shell ` --expect-command-boundary-coverage aetheria:aetheria.daemon.editor:tui:covered:EveTui:tui ` --expect-split-target-proof "EveUnity:Aetheria daemon 3D ARPG world lowers through a generic EveUnity playable-world client" ` - --expect-runtime-capture-artifact unity-uitoolkit:json-projection:gamecult.eve.unity_uitoolkit_projection.v1:aetheria:aetheria.daemon.game ` --expect-runtime-capture-probe electron-shell:contract-artifact-present:png:EveElectron ` --expect-runtime-witness electron-shell:aetheria:aetheria.daemon.game:cold:pass ` --expect-runtime-capture-artifact tui:json-grid:gamecult.eve.tui_grid.v1:aetheria:aetheria.daemon.game ` @@ -91,9 +90,6 @@ try { --expect-split-target-proof "EveElectron:Aetheria consumes EveElectron for generic window and preload authority" ` --expect-split-target-blocker "EveTui:TUI package release is cut from EveTui rather than Eve incubation" ` --expect-split-target-blocker "EveTui:TUI capture path is owned by EveTui rather than Eve incubation" ` - --expect-split-handoff-move EveUnity:unity-uitoolkit:aetheria-unity-consumer-boundary:observed-provider:exists:Packages/manifest.json ` - --expect-split-handoff-move EveUnity:unity-uitoolkit:aetheria-unity-consumer-boundary:observed-provider:exists:GameCult.Eve.UnityUIToolkit.csproj ` - --expect-split-handoff-move EveUnity:unity-uitoolkit:aetheria-unity-consumer-boundary:observed-provider:exists:Aetheria.State.Unity/AetheriaRuntimeCatalogClient.cs ` --expect-provider-command aetheria:aetheria.daemon.commands ` --expect-provider-receipt-state aetheria:accepted ` --expect-provider-receipt-state aetheria:pending ` diff --git a/scripts/run-conformance-consumer-smoke.ps1 b/scripts/run-conformance-consumer-smoke.ps1 index 9d0ab3a..a3a0fcc 100644 --- a/scripts/run-conformance-consumer-smoke.ps1 +++ b/scripts/run-conformance-consumer-smoke.ps1 @@ -100,7 +100,7 @@ try { --expect-screenshot-metric web:eve-world-smoke:text-presence:pass ` --expect-screenshot-metric web:eve-world-smoke:bounding-boxes:pass ` --expect-screenshot-metric electron-shell:aetheria-world:bounding-boxes:pending-capture ` - --expect-runtime-capture-probe unity-uitoolkit:semantic-artifact-present-capture-pending:png:EveUnity ` + --expect-runtime-capture-probe unity-uitoolkit:contract-artifact-missing:png:EveUnity ` --expect-runtime-capture-probe unity-scene:control-artifact-present-product-capture-pending:png:EveUnity ` --expect-runtime-capture-probe electron-shell:contract-artifact-present:png:EveElectron ` --expect-runtime-witness electron-shell:eve.world-smoke:eve.world-smoke.surface:cold:pass ` diff --git a/scripts/run-eveunity-capture-contract-smoke.ps1 b/scripts/run-eveunity-capture-contract-smoke.ps1 deleted file mode 100644 index a0981fd..0000000 --- a/scripts/run-eveunity-capture-contract-smoke.ps1 +++ /dev/null @@ -1,99 +0,0 @@ -param( - [string] $CapabilityManifestPath = "packages\org.gamecult.eve.unity-uitoolkit\eve-runtime-capability.json", - [string] $AdvertisementPath = "web\fixtures\aetheria.provider-advertisement.json", - [string] $OutputPath = "artifacts\eveunity-uitoolkit-capture-contract\latest\capture-request.json", - [string] $Stamp = "smoke" -) - -$ErrorActionPreference = "Stop" - -$projectRoot = Split-Path -Parent $PSScriptRoot -$absoluteCapabilityPath = if ([System.IO.Path]::IsPathRooted($CapabilityManifestPath)) { - $CapabilityManifestPath -} else { - Join-Path $projectRoot $CapabilityManifestPath -} -$absoluteAdvertisementPath = if ([System.IO.Path]::IsPathRooted($AdvertisementPath)) { - $AdvertisementPath -} else { - Join-Path $projectRoot $AdvertisementPath -} -$absoluteOutputPath = if ([System.IO.Path]::IsPathRooted($OutputPath)) { - $OutputPath -} else { - Join-Path $projectRoot $OutputPath -} - -foreach ($path in @($absoluteCapabilityPath, $absoluteAdvertisementPath)) { - if (-not (Test-Path -LiteralPath $path)) { - throw "EveUnity capture contract input not found: $path" - } -} - -$manifest = Get-Content -LiteralPath $absoluteCapabilityPath -Raw | ConvertFrom-Json -$captureContract = $manifest.lifecycle.capture.captureContract -if ($null -eq $captureContract) { - throw "EveUnity capture contract missing lifecycle.capture.captureContract" -} -foreach ($field in @("ownerRepo", "runtimeId", "targetId", "requestSchema", "requestBuilder", "advertisementPath", "captureKind", "artifactKind", "artifactPattern", "conformanceAttachment", "requiredProvider", "requiredSurface", "authority", "publishProof")) { - if (-not $captureContract.$field) { - throw "EveUnity capture contract missing $field" - } -} -if ($captureContract.ownerRepo -ne "EveUnity") { - throw "Unexpected EveUnity capture owner: $($captureContract.ownerRepo)" -} -if ($captureContract.runtimeId -ne "unity-uitoolkit") { - throw "Unexpected EveUnity capture runtime: $($captureContract.runtimeId)" -} -if ($captureContract.targetId -ne "unity-uitoolkit") { - throw "Unexpected EveUnity capture target: $($captureContract.targetId)" -} -if ($captureContract.requestSchema -ne "gamecult.eve.runtime_capture_request.v1") { - throw "Unexpected EveUnity capture request schema: $($captureContract.requestSchema)" -} - -$builderPath = Join-Path $projectRoot $captureContract.requestBuilder -if (-not (Test-Path -LiteralPath $builderPath)) { - throw "EveUnity capture request builder not found: $($captureContract.requestBuilder)" -} -if ((Join-Path $projectRoot $captureContract.advertisementPath) -ne $absoluteAdvertisementPath) { - throw "EveUnity capture advertisement path mismatch: $($captureContract.advertisementPath) vs $AdvertisementPath" -} - -node --test (Join-Path $projectRoot "tools\eveunity\eveunity-capture-contract.test.mjs") -if ($LASTEXITCODE -ne 0) { - throw "EveUnity capture contract tests failed with exit code $LASTEXITCODE" -} - -node $builderPath --capability $absoluteCapabilityPath --advertisement $absoluteAdvertisementPath --output $absoluteOutputPath --stamp $Stamp -if ($LASTEXITCODE -ne 0) { - throw "EveUnity capture request builder failed with exit code $LASTEXITCODE" -} -if (-not (Test-Path -LiteralPath $absoluteOutputPath)) { - throw "EveUnity capture request was not written: $absoluteOutputPath" -} - -$request = Get-Content -LiteralPath $absoluteOutputPath -Raw | ConvertFrom-Json -foreach ($expectation in @( - @{ field = "schema"; value = "gamecult.eve.runtime_capture_request.v1" }, - @{ field = "runtimeId"; value = "unity-uitoolkit" }, - @{ field = "ownerRepo"; value = "EveUnity" }, - @{ field = "providerId"; value = "aetheria" }, - @{ field = "surfaceId"; value = "aetheria.daemon.game" }, - @{ field = "targetId"; value = "unity-uitoolkit" }, - @{ field = "commandBoundary"; value = "aetheria.daemon.commands" }, - @{ field = "receiptSchema"; value = "aetheria.eve_command_acceptance_status.v1" }, - @{ field = "captureKind"; value = "unity-editor-or-batchmode-png" }, - @{ field = "artifactKind"; value = "png" }, - @{ field = "conformanceAttachment"; value = "runtime.captureArtifacts[]" } -)) { - if ($request.($expectation.field) -ne $expectation.value) { - throw "EveUnity capture request $($expectation.field) expected $($expectation.value) got $($request.($expectation.field))" - } -} -if ($request.artifactPath -ne "artifacts/eveunity-uitoolkit-capture/$Stamp/unity-uitoolkit.png") { - throw "Unexpected EveUnity capture artifact path: $($request.artifactPath)" -} - -Write-Host "EveUnity capture contract smoke passed: $absoluteOutputPath" diff --git a/scripts/run-eveunity-lifecycle-smoke.ps1 b/scripts/run-eveunity-lifecycle-smoke.ps1 deleted file mode 100644 index f7fddaa..0000000 --- a/scripts/run-eveunity-lifecycle-smoke.ps1 +++ /dev/null @@ -1,289 +0,0 @@ -param( - [string] $CapabilityManifestPath = "packages\org.gamecult.eve.unity-uitoolkit\eve-runtime-capability.json", - [switch] $RunUnityEditMode -) - -$ErrorActionPreference = "Stop" - -$projectRoot = Split-Path -Parent $PSScriptRoot -$absoluteManifestPath = if ([System.IO.Path]::IsPathRooted($CapabilityManifestPath)) { - $CapabilityManifestPath -} else { - Join-Path $projectRoot $CapabilityManifestPath -} - -if (-not (Test-Path -LiteralPath $absoluteManifestPath)) { - throw "EveUnity runtime capability manifest not found: $absoluteManifestPath" -} - -$manifest = Get-Content -LiteralPath $absoluteManifestPath -Raw | ConvertFrom-Json - -if ($manifest.schema -ne "gamecult.eve.runtime_capability.v1") { - throw "Unexpected EveUnity manifest schema: $($manifest.schema)" -} -if ($manifest.runtimeId -ne "unity-uitoolkit") { - throw "Unexpected EveUnity runtime id: $($manifest.runtimeId)" -} -if ($manifest.owner -ne "EveUnity") { - throw "Unexpected EveUnity owner: $($manifest.owner)" -} -if ($manifest.incubation.ownerRepo -ne "EveUnity") { - throw "Unexpected EveUnity incubation owner: $($manifest.incubation.ownerRepo)" -} -if ($manifest.incubation.currentHostRepo -ne "Eve") { - throw "Unexpected EveUnity current host repo: $($manifest.incubation.currentHostRepo)" -} -if ($manifest.incubation.splitTarget -ne "EveUnity") { - throw "Unexpected EveUnity split target: $($manifest.incubation.splitTarget)" -} -if (-not $manifest.incubation.splitHandoff.manifestPath) { - throw "EveUnity manifest missing split handoff path" -} - -foreach ($feature in @("embeddedDocuments")) { - if (-not ($manifest.supportedFeatures -contains $feature)) { - throw "EveUnity manifest missing supported feature: $feature" - } -} - -$pluginClaims = @{} -foreach ($plugin in $manifest.supportedPlugins) { - $pluginClaims[$plugin.pluginId] = @($plugin.capabilities) -} -foreach ($claim in @( - @{ pluginId = "sai.vn"; capabilities = @("vn.stage", "story.choose", "story.continue", "story.jump") }, - @{ pluginId = "norn.graph"; capabilities = @("embed.norn") }, - @{ pluginId = "tex.math"; capabilities = @("embed.tex", "tex.inline", "tex.block") } -)) { - if (-not $pluginClaims.ContainsKey($claim.pluginId)) { - throw "EveUnity manifest missing plugin claim: $($claim.pluginId)" - } - foreach ($capability in $claim.capabilities) { - if (-not ($pluginClaims[$claim.pluginId] -contains $capability)) { - throw "EveUnity manifest missing plugin capability: $($claim.pluginId):$capability" - } - } -} - -if ($manifest.commandTransport.schema -ne "gamecult.eve.command_invocation.v1") { - throw "Unexpected EveUnity command schema: $($manifest.commandTransport.schema)" -} - -foreach ($stage in @("release", "test", "capture")) { - $stageDocument = $manifest.lifecycle.$stage - if ($null -eq $stageDocument) { - throw "EveUnity lifecycle missing stage: $stage" - } - if ($stageDocument.ownerRepo -ne "EveUnity") { - throw "EveUnity lifecycle stage $stage has unexpected owner: $($stageDocument.ownerRepo)" - } - if (-not $stageDocument.status) { - throw "EveUnity lifecycle stage $stage missing status" - } - foreach ($evidencePath in $stageDocument.evidencePaths) { - $absoluteEvidencePath = Join-Path $projectRoot $evidencePath - if (-not (Test-Path -LiteralPath $absoluteEvidencePath)) { - throw "EveUnity lifecycle stage $stage missing evidence path: $evidencePath" - } - } -} - -$releaseContract = $manifest.lifecycle.release.releaseContract -if ($null -eq $releaseContract) { - throw "EveUnity release lifecycle missing releaseContract" -} -if ($releaseContract.ownerRepo -ne "EveUnity") { - throw "EveUnity release contract has unexpected owner: $($releaseContract.ownerRepo)" -} -if ($releaseContract.packageName -ne "org.gamecult.eve.unity-uitoolkit") { - throw "EveUnity release contract has unexpected package name: $($releaseContract.packageName)" -} -if ($releaseContract.artifactKind -ne "upm-package") { - throw "EveUnity release contract has unexpected artifact kind: $($releaseContract.artifactKind)" -} -if ($releaseContract.requestSchema -ne "gamecult.eve.runtime_release_request.v1") { - throw "EveUnity release contract has unexpected request schema: $($releaseContract.requestSchema)" -} -if (-not ($releaseContract.tagPattern -match "\{version\}")) { - throw "EveUnity release contract tag pattern must include {version}: $($releaseContract.tagPattern)" -} -if (-not ($releaseContract.artifactPattern -match "\{version\}")) { - throw "EveUnity release contract artifact pattern must include {version}: $($releaseContract.artifactPattern)" -} -foreach ($pathProperty in @("packageRoot", "versionSource", "requestBuilder", "artifactBuilder")) { - $relativePath = $releaseContract.$pathProperty - if (-not $relativePath) { - throw "EveUnity release contract missing $pathProperty" - } - $absolutePath = Join-Path $projectRoot $relativePath - if (-not (Test-Path -LiteralPath $absolutePath)) { - throw "EveUnity release contract $pathProperty does not exist: $relativePath" - } -} -$packageManifest = Get-Content -LiteralPath (Join-Path $projectRoot $releaseContract.versionSource) -Raw | ConvertFrom-Json -if ($packageManifest.name -ne $releaseContract.packageName) { - throw "EveUnity release contract package name does not match package manifest: $($releaseContract.packageName) vs $($packageManifest.name)" -} -if (-not $packageManifest.version) { - throw "EveUnity release contract package manifest missing version" -} -if ($packageManifest.dependencies."org.gamecult.eve.surface" -ne "0.1.0") { - throw "EveUnity package manifest missing org.gamecult.eve.surface dependency" -} -$surfaceDependency = @($releaseContract.requiredPackageDependencies) | Where-Object { $_.packageName -eq "org.gamecult.eve.surface" } | Select-Object -First 1 -if (-not $surfaceDependency) { - throw "EveUnity release contract missing required org.gamecult.eve.surface dependency contract" -} -if ($surfaceDependency.ownerRepo -ne "Eve" -or $surfaceDependency.packageManager -ne "upm") { - throw "EveUnity release contract has unexpected surface dependency owner/package manager: $($surfaceDependency.ownerRepo)/$($surfaceDependency.packageManager)" -} -if ($surfaceDependency.version -ne $packageManifest.dependencies."org.gamecult.eve.surface") { - throw "EveUnity release contract surface dependency version mismatch: $($surfaceDependency.version)" -} - -& (Join-Path $projectRoot "scripts\run-eveunity-release-contract-smoke.ps1") -if ($LASTEXITCODE -ne 0) { - throw "EveUnity release contract smoke failed with exit code $LASTEXITCODE" -} - -& (Join-Path $projectRoot "scripts\run-eveunity-release-artifact-smoke.ps1") -if ($LASTEXITCODE -ne 0) { - throw "EveUnity release artifact smoke failed with exit code $LASTEXITCODE" -} - -$testContract = $manifest.lifecycle.test.testContract -if ($null -eq $testContract) { - throw "EveUnity test lifecycle missing testContract" -} -if ($testContract.ownerRepo -ne "EveUnity") { - throw "EveUnity test contract has unexpected owner: $($testContract.ownerRepo)" -} -if ($testContract.runnerKind -ne "unity-editmode-batchmode") { - throw "EveUnity test contract has unexpected runner kind: $($testContract.runnerKind)" -} -if ($testContract.packageName -ne "org.gamecult.eve.unity-uitoolkit") { - throw "EveUnity test contract has unexpected package name: $($testContract.packageName)" -} -if ($testContract.testAssembly -ne "GameCult.Eve.UnityUIToolkit.Tests") { - throw "EveUnity test contract has unexpected test assembly: $($testContract.testAssembly)" -} -if ($testContract.testPlatform -ne "EditMode") { - throw "EveUnity test contract has unexpected test platform: $($testContract.testPlatform)" -} -$managedDependencies = @($testContract.managedAssemblyDependencies) -$testAssemblyDefinitionPath = Join-Path $projectRoot "packages\org.gamecult.eve.unity-uitoolkit\Tests\Editor\GameCult.Eve.UnityUIToolkit.Tests.asmdef" -$testAssemblyDefinition = Get-Content -LiteralPath $testAssemblyDefinitionPath -Raw | ConvertFrom-Json -foreach ($dependency in @( - @{ assemblyName = "GameCult.Caching.dll"; packageId = "GameCult.Caching" }, - @{ assemblyName = "GameCult.Mesh.dll"; packageId = "GameCult.Mesh" }, - @{ assemblyName = "MessagePack.Annotations.dll"; packageId = "MessagePack.Annotations" } -)) { - $record = $managedDependencies | Where-Object { $_.assemblyName -eq $dependency.assemblyName } | Select-Object -First 1 - if (-not $record) { - throw "EveUnity test contract missing managed assembly dependency: $($dependency.assemblyName)" - } - if ($record.packageId -ne $dependency.packageId -or $record.packageManager -ne "nuget" -or $record.ownerRepo -ne "CultLib") { - throw "EveUnity test contract has unexpected managed dependency record for $($dependency.assemblyName)" - } - if ($null -eq $record.dependencyContract) { - throw "EveUnity test contract missing dependency contract for $($dependency.assemblyName)" - } - if ($record.dependencyContract.sourceAuthority -ne "CultLib" -or $record.dependencyContract.packageSource -ne "nuget") { - throw "EveUnity test contract has unexpected dependency source for $($dependency.assemblyName): $($record.dependencyContract.sourceAuthority)/$($record.dependencyContract.packageSource)" - } - if ($record.dependencyContract.packageId -ne $dependency.packageId -or $record.dependencyContract.assemblyName -ne $dependency.assemblyName) { - throw "EveUnity test contract dependency contract does not match managed dependency identity for $($dependency.assemblyName)" - } - foreach ($field in @("versionPolicy", "unityResolution", "handoffRequirement")) { - if (-not $record.dependencyContract.$field) { - throw "EveUnity test contract dependency contract missing $field for $($dependency.assemblyName)" - } - } - if (-not (@($testAssemblyDefinition.precompiledReferences) -contains $dependency.assemblyName)) { - throw "EveUnity test asmdef missing managed dependency precompiled reference: $($dependency.assemblyName)" - } -} -foreach ($pathProperty in @("runnerScript", "consumerProject")) { - $candidate = $testContract.$pathProperty - if (-not $candidate) { - throw "EveUnity test contract missing $pathProperty" - } - $absolutePath = if ([System.IO.Path]::IsPathRooted($candidate)) { - $candidate - } else { - Join-Path $projectRoot $candidate - } - if (-not (Test-Path -LiteralPath $absolutePath)) { - throw "EveUnity test contract $pathProperty does not exist: $candidate" - } -} -$runnerSource = Get-Content -LiteralPath (Join-Path $projectRoot $testContract.runnerScript) -Raw -foreach ($expectedText in @($testContract.packageName, $testContract.testAssembly, $testContract.testPlatform, "testables", "Restore-Manifest")) { - if (-not $runnerSource.Contains($expectedText)) { - throw "EveUnity test contract runner script missing expected text: $expectedText" - } -} - -$captureContract = $manifest.lifecycle.capture.captureContract -if ($null -eq $captureContract) { - throw "EveUnity capture lifecycle missing captureContract" -} -if ($captureContract.ownerRepo -ne "EveUnity") { - throw "EveUnity capture contract has unexpected owner: $($captureContract.ownerRepo)" -} -if ($captureContract.runtimeId -ne "unity-uitoolkit") { - throw "EveUnity capture contract has unexpected runtime: $($captureContract.runtimeId)" -} -if ($captureContract.targetId -ne "unity-uitoolkit") { - throw "EveUnity capture contract has unexpected target: $($captureContract.targetId)" -} -if ($captureContract.requestSchema -ne "gamecult.eve.runtime_capture_request.v1") { - throw "EveUnity capture contract has unexpected request schema: $($captureContract.requestSchema)" -} -if ($captureContract.captureKind -ne "unity-editor-or-batchmode-png") { - throw "EveUnity capture contract has unexpected capture kind: $($captureContract.captureKind)" -} -if ($captureContract.artifactKind -ne "png") { - throw "EveUnity capture contract has unexpected artifact kind: $($captureContract.artifactKind)" -} -foreach ($field in @("requestBuilder", "advertisementPath", "artifactPattern", "conformanceAttachment", "requiredProvider", "requiredSurface", "authority", "publishProof")) { - if (-not $captureContract.$field) { - throw "EveUnity capture contract missing $field" - } -} -foreach ($pathProperty in @("requestBuilder", "advertisementPath")) { - $relativePath = $captureContract.$pathProperty - $absolutePath = Join-Path $projectRoot $relativePath - if (-not (Test-Path -LiteralPath $absolutePath)) { - throw "EveUnity capture contract $pathProperty does not exist: $relativePath" - } -} - -& (Join-Path $projectRoot "scripts\run-eveunity-capture-contract-smoke.ps1") -if ($LASTEXITCODE -ne 0) { - throw "EveUnity capture contract smoke failed with exit code $LASTEXITCODE" -} - -& (Join-Path $projectRoot "scripts\run-eveunity-uitoolkit-capture-smoke.ps1") -if ($LASTEXITCODE -ne 0) { - throw "EveUnity UI Toolkit capture smoke failed with exit code $LASTEXITCODE" -} - -& (Join-Path $projectRoot "scripts\run-aetheria-unity-package-smoke.ps1") -if ($LASTEXITCODE -ne 0) { - throw "Aetheria Unity package smoke failed with exit code $LASTEXITCODE" -} - -& (Join-Path $projectRoot "scripts\run-eveunity-split-handoff-smoke.ps1") -if ($LASTEXITCODE -ne 0) { - throw "EveUnity split handoff smoke failed with exit code $LASTEXITCODE" -} - -if ($RunUnityEditMode) { - & (Join-Path $projectRoot "scripts\run-aetheria-unity-editmode-tests.ps1") - if ($LASTEXITCODE -ne 0) { - throw "Aetheria Unity EditMode smoke failed with exit code $LASTEXITCODE" - } -} - -Write-Host "EveUnity lifecycle smoke passed: $absoluteManifestPath" diff --git a/scripts/run-eveunity-owner-smoke.ps1 b/scripts/run-eveunity-owner-smoke.ps1 new file mode 100644 index 0000000..888d8e0 --- /dev/null +++ b/scripts/run-eveunity-owner-smoke.ps1 @@ -0,0 +1,44 @@ +param( + [string] $EveUnityRoot = "E:\Projects\EveUnity", + [string] $AetheriaRoot = "E:\Projects\Aetheria" +) + +$ErrorActionPreference = "Stop" + +$requiredOwnerPaths = @( + "packages\org.gamecult.eve.surface\package.json", + "packages\org.gamecult.eve.unity-uitoolkit\package.json", + "packages\org.gamecult.eve.unity-uitoolkit\eve-runtime-capability.json", + "packages\org.gamecult.eve.unity-scene\package.json", + "packages\org.gamecult.eve.unity-scene\eve-runtime-capability.json", + "scripts\pack-uitoolkit.ps1", + "scripts\run-uitoolkit-tests.ps1" +) + +foreach ($relativePath in $requiredOwnerPaths) { + $path = Join-Path $EveUnityRoot $relativePath + if (-not (Test-Path -LiteralPath $path -PathType Leaf)) { + throw "EveUnity owner path is missing: $path" + } +} + +$aetheriaManifest = Get-Content (Join-Path $AetheriaRoot "Packages\manifest.json") -Raw | ConvertFrom-Json +$expectedDependencies = @{ + "org.gamecult.eve.surface" = "file:../../EveUnity/packages/org.gamecult.eve.surface" + "org.gamecult.eve.unity-uitoolkit" = "file:../../EveUnity/packages/org.gamecult.eve.unity-uitoolkit" + "org.gamecult.eve.unity-scene" = "file:../../EveUnity/packages/org.gamecult.eve.unity-scene" +} + +foreach ($entry in $expectedDependencies.GetEnumerator()) { + $actual = $aetheriaManifest.dependencies.($entry.Key) + if ($actual -ne $entry.Value) { + throw "Aetheria dependency $($entry.Key) resolves to '$actual', expected '$($entry.Value)'." + } +} + +& (Join-Path $EveUnityRoot "scripts\pack-uitoolkit.ps1") +if ($LASTEXITCODE -ne 0) { + throw "EveUnity UI Toolkit package smoke failed." +} + +Write-Host "EveUnity owns the Unity packages and Aetheria consumes them from the owner repo." diff --git a/scripts/run-eveunity-release-artifact-smoke.ps1 b/scripts/run-eveunity-release-artifact-smoke.ps1 deleted file mode 100644 index fcc53d7..0000000 --- a/scripts/run-eveunity-release-artifact-smoke.ps1 +++ /dev/null @@ -1,107 +0,0 @@ -param( - [string] $CapabilityManifestPath = "packages\org.gamecult.eve.unity-uitoolkit\eve-runtime-capability.json", - [string] $RequestOutputPath = "artifacts\eveunity-uitoolkit-release-contract\latest\release-request.json", - [string] $ProofOutputPath = "artifacts\eveunity-uitoolkit-release\latest\release-artifact.json", - [string] $ReleaseContractSmokePath = "scripts\run-eveunity-release-contract-smoke.ps1" -) - -$ErrorActionPreference = "Stop" - -$projectRoot = Split-Path -Parent $PSScriptRoot -$absoluteCapabilityPath = if ([System.IO.Path]::IsPathRooted($CapabilityManifestPath)) { - $CapabilityManifestPath -} else { - Join-Path $projectRoot $CapabilityManifestPath -} -$absoluteRequestOutputPath = if ([System.IO.Path]::IsPathRooted($RequestOutputPath)) { - $RequestOutputPath -} else { - Join-Path $projectRoot $RequestOutputPath -} -$absoluteProofOutputPath = if ([System.IO.Path]::IsPathRooted($ProofOutputPath)) { - $ProofOutputPath -} else { - Join-Path $projectRoot $ProofOutputPath -} - -if (-not (Test-Path -LiteralPath $absoluteCapabilityPath)) { - throw "EveUnity release artifact input not found: $absoluteCapabilityPath" -} - -$manifest = Get-Content -LiteralPath $absoluteCapabilityPath -Raw | ConvertFrom-Json -$releaseContract = $manifest.lifecycle.release.releaseContract -if ($null -eq $releaseContract) { - throw "EveUnity release artifact smoke missing lifecycle.release.releaseContract" -} -if ($releaseContract.ownerRepo -ne "EveUnity") { - throw "Unexpected EveUnity release artifact owner: $($releaseContract.ownerRepo)" -} -if ($releaseContract.artifactKind -ne "upm-package") { - throw "Unexpected EveUnity release artifact kind: $($releaseContract.artifactKind)" -} -if (-not $releaseContract.artifactBuilder) { - throw "EveUnity release contract missing artifactBuilder" -} -$artifactBuilderPath = Join-Path $projectRoot $releaseContract.artifactBuilder -if (-not (Test-Path -LiteralPath $artifactBuilderPath)) { - throw "EveUnity release artifact builder not found: $($releaseContract.artifactBuilder)" -} -$releaseContractSmoke = if ([System.IO.Path]::IsPathRooted($ReleaseContractSmokePath)) { - $ReleaseContractSmokePath -} else { - Join-Path $projectRoot $ReleaseContractSmokePath -} -if (-not (Test-Path -LiteralPath $releaseContractSmoke)) { - throw "EveUnity release contract smoke not found: $ReleaseContractSmokePath" -} - -node --test (Join-Path $projectRoot "tools\eveunity\eveunity-release-artifact.test.mjs") -if ($LASTEXITCODE -ne 0) { - throw "EveUnity release artifact tests failed with exit code $LASTEXITCODE" -} - -& $releaseContractSmoke ` - -CapabilityManifestPath $CapabilityManifestPath ` - -OutputPath $RequestOutputPath -if ($LASTEXITCODE -ne 0) { - throw "EveUnity release contract smoke failed with exit code $LASTEXITCODE" -} - -node $artifactBuilderPath ` - --project-root $projectRoot ` - --request $RequestOutputPath ` - --proof-output $ProofOutputPath -if ($LASTEXITCODE -ne 0) { - throw "EveUnity release artifact builder failed with exit code $LASTEXITCODE" -} - -if (-not (Test-Path -LiteralPath $absoluteProofOutputPath)) { - throw "EveUnity release artifact proof was not written: $absoluteProofOutputPath" -} - -$proof = Get-Content -LiteralPath $absoluteProofOutputPath -Raw | ConvertFrom-Json -foreach ($expectation in @( - @{ field = "schema"; value = "gamecult.eve.runtime_release_artifact.v1" }, - @{ field = "ownerRepo"; value = "EveUnity" }, - @{ field = "repository"; value = "GameCult/EveUnity" }, - @{ field = "packageName"; value = $releaseContract.packageName }, - @{ field = "artifactKind"; value = "upm-package" } -)) { - if ($proof.($expectation.field) -ne $expectation.value) { - throw "EveUnity release artifact proof $($expectation.field) expected $($expectation.value) got $($proof.($expectation.field))" - } -} -if ($proof.artifactSizeBytes -le 0) { - throw "EveUnity release artifact proof has invalid size: $($proof.artifactSizeBytes)" -} - -$artifactPath = if ([System.IO.Path]::IsPathRooted($proof.artifactPath)) { - $proof.artifactPath -} else { - Join-Path $projectRoot $proof.artifactPath -} -if (-not (Test-Path -LiteralPath $artifactPath)) { - throw "EveUnity release artifact was not written: $artifactPath" -} - -Write-Host "EveUnity release artifact smoke passed: $artifactPath" diff --git a/scripts/run-eveunity-release-contract-smoke.ps1 b/scripts/run-eveunity-release-contract-smoke.ps1 deleted file mode 100644 index 78f7a09..0000000 --- a/scripts/run-eveunity-release-contract-smoke.ps1 +++ /dev/null @@ -1,106 +0,0 @@ -param( - [string] $CapabilityManifestPath = "packages\org.gamecult.eve.unity-uitoolkit\eve-runtime-capability.json", - [string] $OutputPath = "artifacts\eveunity-uitoolkit-release-contract\latest\release-request.json" -) - -$ErrorActionPreference = "Stop" - -$projectRoot = Split-Path -Parent $PSScriptRoot -$absoluteCapabilityPath = if ([System.IO.Path]::IsPathRooted($CapabilityManifestPath)) { - $CapabilityManifestPath -} else { - Join-Path $projectRoot $CapabilityManifestPath -} -$absoluteOutputPath = if ([System.IO.Path]::IsPathRooted($OutputPath)) { - $OutputPath -} else { - Join-Path $projectRoot $OutputPath -} - -if (-not (Test-Path -LiteralPath $absoluteCapabilityPath)) { - throw "EveUnity release contract input not found: $absoluteCapabilityPath" -} - -$manifest = Get-Content -LiteralPath $absoluteCapabilityPath -Raw | ConvertFrom-Json -$releaseContract = $manifest.lifecycle.release.releaseContract -if ($null -eq $releaseContract) { - throw "EveUnity release contract missing lifecycle.release.releaseContract" -} -foreach ($field in @("ownerRepo", "packageName", "packageRoot", "versionSource", "tagPattern", "artifactKind", "requestSchema", "requestBuilder", "artifactBuilder", "artifactPattern", "publishProof")) { - if (-not $releaseContract.$field) { - throw "EveUnity release contract missing $field" - } -} -if ($releaseContract.ownerRepo -ne "EveUnity") { - throw "Unexpected EveUnity release owner: $($releaseContract.ownerRepo)" -} -if ($releaseContract.requestSchema -ne "gamecult.eve.runtime_release_request.v1") { - throw "Unexpected EveUnity release request schema: $($releaseContract.requestSchema)" -} -if ($releaseContract.artifactKind -ne "upm-package") { - throw "Unexpected EveUnity release artifact kind: $($releaseContract.artifactKind)" -} - -$builderPath = Join-Path $projectRoot $releaseContract.requestBuilder -$artifactBuilderPath = Join-Path $projectRoot $releaseContract.artifactBuilder -$packagePath = Join-Path $projectRoot $releaseContract.versionSource -$packageRoot = Join-Path $projectRoot $releaseContract.packageRoot -foreach ($path in @($builderPath, $artifactBuilderPath, $packagePath, $packageRoot)) { - if (-not (Test-Path -LiteralPath $path)) { - throw "EveUnity release contract path not found: $path" - } -} - -node --test (Join-Path $projectRoot "tools\eveunity\eveunity-release-contract.test.mjs") -if ($LASTEXITCODE -ne 0) { - throw "EveUnity release contract tests failed with exit code $LASTEXITCODE" -} - -node $builderPath --capability $absoluteCapabilityPath --package $packagePath --output $absoluteOutputPath -if ($LASTEXITCODE -ne 0) { - throw "EveUnity release request builder failed with exit code $LASTEXITCODE" -} -if (-not (Test-Path -LiteralPath $absoluteOutputPath)) { - throw "EveUnity release request was not written: $absoluteOutputPath" -} - -$request = Get-Content -LiteralPath $absoluteOutputPath -Raw | ConvertFrom-Json -$packageManifest = Get-Content -LiteralPath $packagePath -Raw | ConvertFrom-Json -foreach ($expectation in @( - @{ field = "schema"; value = "gamecult.eve.runtime_release_request.v1" }, - @{ field = "ownerRepo"; value = "EveUnity" }, - @{ field = "repository"; value = "GameCult/EveUnity" }, - @{ field = "packageName"; value = "org.gamecult.eve.unity-uitoolkit" }, - @{ field = "version"; value = $packageManifest.version }, - @{ field = "packageRoot"; value = "packages/org.gamecult.eve.unity-uitoolkit" }, - @{ field = "versionSource"; value = "packages/org.gamecult.eve.unity-uitoolkit/package.json" }, - @{ field = "artifactKind"; value = "upm-package" } -)) { - if ($request.($expectation.field) -ne $expectation.value) { - throw "EveUnity release request $($expectation.field) expected $($expectation.value) got $($request.($expectation.field))" - } -} - -$expectedTagName = $releaseContract.tagPattern.Replace("{version}", $packageManifest.version) -if ($request.tagName -ne $expectedTagName) { - throw "Unexpected EveUnity release tag: $($request.tagName)" -} -$expectedArtifactPath = $releaseContract.artifactPattern.Replace("{version}", $packageManifest.version) -if ($request.artifactPath -ne $expectedArtifactPath) { - throw "Unexpected EveUnity release artifact path: $($request.artifactPath)" -} -if ($request.dependencies."org.gamecult.eve.surface" -ne $packageManifest.dependencies."org.gamecult.eve.surface") { - throw "EveUnity release request lost org.gamecult.eve.surface dependency" -} -$surfaceDependency = @($request.requiredPackageDependencies) | Where-Object { $_.packageName -eq "org.gamecult.eve.surface" } | Select-Object -First 1 -if (-not $surfaceDependency) { - throw "EveUnity release request missing required org.gamecult.eve.surface dependency contract" -} -if ($surfaceDependency.ownerRepo -ne "Eve" -or $surfaceDependency.packageManager -ne "upm") { - throw "EveUnity release request has unexpected surface dependency owner/package manager: $($surfaceDependency.ownerRepo)/$($surfaceDependency.packageManager)" -} -if ($surfaceDependency.version -ne $packageManifest.dependencies."org.gamecult.eve.surface") { - throw "EveUnity release request surface dependency version mismatch: $($surfaceDependency.version)" -} - -Write-Host "EveUnity release contract smoke passed: $absoluteOutputPath" diff --git a/scripts/run-eveunity-split-handoff-smoke.ps1 b/scripts/run-eveunity-split-handoff-smoke.ps1 deleted file mode 100644 index 38a75a2..0000000 --- a/scripts/run-eveunity-split-handoff-smoke.ps1 +++ /dev/null @@ -1,139 +0,0 @@ -param( - [string] $HandoffPath = "packages\org.gamecult.eve.unity-uitoolkit\eveunity-split-handoff.json", - [string] $CapabilityPath = "packages\org.gamecult.eve.unity-uitoolkit\eve-runtime-capability.json" -) - -$ErrorActionPreference = "Stop" - -$projectRoot = Split-Path -Parent $PSScriptRoot -$absoluteHandoffPath = if ([System.IO.Path]::IsPathRooted($HandoffPath)) { - $HandoffPath -} else { - Join-Path $projectRoot $HandoffPath -} -$absoluteCapabilityPath = if ([System.IO.Path]::IsPathRooted($CapabilityPath)) { - $CapabilityPath -} else { - Join-Path $projectRoot $CapabilityPath -} - -if (-not (Test-Path -LiteralPath $absoluteHandoffPath)) { - throw "EveUnity split handoff manifest not found: $absoluteHandoffPath" -} -if (-not (Test-Path -LiteralPath $absoluteCapabilityPath)) { - throw "EveUnity runtime capability manifest not found: $absoluteCapabilityPath" -} - -$handoff = Get-Content -LiteralPath $absoluteHandoffPath -Raw | ConvertFrom-Json -$capability = Get-Content -LiteralPath $absoluteCapabilityPath -Raw | ConvertFrom-Json - -if ($handoff.schema -ne "gamecult.eve.runtime_split_handoff.v1") { - throw "Unexpected EveUnity split handoff schema: $($handoff.schema)" -} -if ($handoff.splitTarget -ne "EveUnity") { - throw "Unexpected EveUnity split handoff target: $($handoff.splitTarget)" -} -if ($handoff.ownerRepo -ne "EveUnity") { - throw "Unexpected EveUnity split handoff owner: $($handoff.ownerRepo)" -} -if ($handoff.currentHostRepo -ne "Eve") { - throw "Unexpected EveUnity split handoff host: $($handoff.currentHostRepo)" -} -if ($handoff.runtimeId -ne "unity-uitoolkit") { - throw "Unexpected EveUnity split handoff runtime: $($handoff.runtimeId)" -} -if ($capability.incubation.splitHandoff.manifestPath -ne $HandoffPath.Replace("\", "/")) { - $expectedPath = $HandoffPath.Replace("\", "/") - throw "EveUnity capability manifest does not point at split handoff. Expected $expectedPath got $($capability.incubation.splitHandoff.manifestPath)" -} - -$expectedStages = @("release", "test", "capture") -foreach ($stage in $expectedStages) { - if (-not $capability.lifecycle.$stage) { - throw "EveUnity capability lifecycle missing stage: $stage" - } -} - -$moveSets = @($handoff.moveSets) -foreach ($stage in $expectedStages) { - $moveSet = $moveSets | Where-Object { $_.stage -eq $stage } | Select-Object -First 1 - if (-not $moveSet) { - throw "EveUnity split handoff missing move set for stage: $stage" - } - if ($moveSet.destinationOwner -ne "EveUnity") { - throw "EveUnity split handoff stage $stage has unexpected destination owner: $($moveSet.destinationOwner)" - } - if (-not $moveSet.replacementProof) { - throw "EveUnity split handoff stage $stage missing replacement proof" - } - - $pendingProofs = @($capability.lifecycle.$stage.pendingProofs) - if (-not ($pendingProofs -contains $moveSet.replacementProof)) { - throw "EveUnity split handoff stage $stage replacement proof is not mirrored in runtime capability pending proofs: $($moveSet.replacementProof)" - } - - foreach ($relativePath in @($moveSet.currentPaths)) { - $absolutePath = Join-Path $projectRoot $relativePath - if (-not (Test-Path -LiteralPath $absolutePath)) { - throw "EveUnity split handoff stage $stage references missing current path: $relativePath" - } - } -} - -$consumerBoundary = $moveSets | Where-Object { $_.id -eq "aetheria-unity-consumer-boundary" } | Select-Object -First 1 -if (-not $consumerBoundary) { - throw "EveUnity split handoff missing Aetheria Unity consumer-boundary move set" -} -if ($consumerBoundary.stage -ne "provider-consumer") { - throw "Aetheria Unity consumer-boundary move set has unexpected stage: $($consumerBoundary.stage)" -} -if ($consumerBoundary.destinationOwner -ne "EveUnity") { - throw "Aetheria Unity consumer-boundary has unexpected destination owner: $($consumerBoundary.destinationOwner)" -} -if (-not $consumerBoundary.replacementProof) { - throw "Aetheria Unity consumer-boundary missing replacement proof" -} -foreach ($relativePath in @($consumerBoundary.currentPaths)) { - $absolutePath = Join-Path $projectRoot $relativePath - if (-not (Test-Path -LiteralPath $absolutePath)) { - throw "Aetheria Unity consumer-boundary references missing current path: $relativePath" - } -} -foreach ($providerPath in @($consumerBoundary.observedProviderPaths)) { - if (-not ([System.IO.Path]::IsPathRooted($providerPath))) { - throw "Aetheria Unity observed provider path must be absolute: $providerPath" - } - if (-not (Test-Path -LiteralPath $providerPath)) { - throw "Aetheria Unity observed provider path is missing: $providerPath" - } -} -foreach ($requiredObservedPath in @( - "E:\Projects\Aetheria\Packages\manifest.json", - "E:\Projects\Aetheria\GameCult.Eve.UnityUIToolkit.csproj", - "E:\Projects\Aetheria\Assets" -)) { - if (-not (@($consumerBoundary.observedProviderPaths) -contains $requiredObservedPath)) { - throw "Aetheria Unity consumer-boundary missing required observed provider path: $requiredObservedPath" - } -} - -foreach ($contract in @( - "gamecult.eve.surface.v1", - "gamecult.eve.command.v1", - "gamecult.eve.provider_advertisement.v1", - "gamecult.eve.plugin_advertisement.v1", - "gamecult.eve.plugin.v1", - "gamecult.eve.conformance_export.v1" -)) { - if (-not (@($handoff.contractInputs) -contains $contract)) { - throw "EveUnity split handoff missing contract input: $contract" - } -} - -foreach ($proof in @($handoff.requiredExternalProofs)) { - if (-not $proof) { - throw "EveUnity split handoff contains an empty required external proof" - } -} - -Write-Host "EveUnity split handoff smoke passed: $absoluteHandoffPath" diff --git a/scripts/run-eveunity-uitoolkit-capture-smoke.ps1 b/scripts/run-eveunity-uitoolkit-capture-smoke.ps1 deleted file mode 100644 index 632dad7..0000000 --- a/scripts/run-eveunity-uitoolkit-capture-smoke.ps1 +++ /dev/null @@ -1,80 +0,0 @@ -param( - [string] $CapabilityManifestPath = "packages\org.gamecult.eve.unity-uitoolkit\eve-runtime-capability.json", - [string] $AdvertisementPath = "web\fixtures\aetheria.provider-advertisement.json", - [string] $SurfacePath = "web\fixtures\aetheria-world-surface.json", - [string] $OutputPath = "artifacts\eveunity-uitoolkit-capture\latest\unity-uitoolkit-projection.json", - [string] $RequestOutputPath = "artifacts\eveunity-uitoolkit-capture\latest\capture-request.json", - [string] $Stamp = "latest", - [string] $ExpectedProviderId = "aetheria", - [string] $ExpectedSurfaceId = "aetheria.daemon.game", - [string] $ExpectedCommandBoundary = "aetheria.daemon.commands", - [string] $ExpectedReceiptSchema = "aetheria.eve_command_acceptance_status.v1" -) - -$ErrorActionPreference = "Stop" - -$projectRoot = Split-Path -Parent $PSScriptRoot -function Resolve-RepoPath([string] $candidate) { - if ([System.IO.Path]::IsPathRooted($candidate)) { - return $candidate - } - return Join-Path $projectRoot $candidate -} - -$absoluteCapabilityPath = Resolve-RepoPath $CapabilityManifestPath -$absoluteAdvertisementPath = Resolve-RepoPath $AdvertisementPath -$absoluteSurfacePath = Resolve-RepoPath $SurfacePath -$absoluteOutputPath = Resolve-RepoPath $OutputPath -$absoluteRequestOutputPath = Resolve-RepoPath $RequestOutputPath - -foreach ($path in @($absoluteCapabilityPath, $absoluteAdvertisementPath, $absoluteSurfacePath)) { - if (-not (Test-Path -LiteralPath $path)) { - throw "EveUnity UI Toolkit capture input not found: $path" - } -} - -node --test (Join-Path $projectRoot "tools\eveunity\eveunity-uitoolkit-capture-artifact.test.mjs") -if ($LASTEXITCODE -ne 0) { - throw "EveUnity UI Toolkit capture artifact tests failed with exit code $LASTEXITCODE" -} - -node (Join-Path $projectRoot "tools\eveunity\eveunity-uitoolkit-capture-artifact.mjs") ` - --capability $absoluteCapabilityPath ` - --advertisement $absoluteAdvertisementPath ` - --surface $absoluteSurfacePath ` - --output $absoluteOutputPath ` - --request-output $absoluteRequestOutputPath ` - --stamp $Stamp -if ($LASTEXITCODE -ne 0) { - throw "EveUnity UI Toolkit capture artifact builder failed with exit code $LASTEXITCODE" -} - -foreach ($path in @($absoluteOutputPath, $absoluteRequestOutputPath)) { - if (-not (Test-Path -LiteralPath $path)) { - throw "EveUnity UI Toolkit capture artifact output missing: $path" - } -} - -$projection = Get-Content -LiteralPath $absoluteOutputPath -Raw | ConvertFrom-Json -foreach ($expectation in @( - @{ field = "schema"; value = "gamecult.eve.unity_uitoolkit_projection.v1" }, - @{ field = "runtimeId"; value = "unity-uitoolkit" }, - @{ field = "providerId"; value = $ExpectedProviderId }, - @{ field = "surfaceId"; value = $ExpectedSurfaceId }, - @{ field = "commandBoundary"; value = $ExpectedCommandBoundary }, - @{ field = "receiptSchema"; value = $ExpectedReceiptSchema }, - @{ field = "artifactKind"; value = "json-projection" }, - @{ field = "captureKind"; value = "unity-uitoolkit-projection-json" } -)) { - if ($projection.($expectation.field) -ne $expectation.value) { - throw "EveUnity UI Toolkit projection $($expectation.field) expected $($expectation.value) got $($projection.($expectation.field))" - } -} -if (-not $projection.root.id) { - throw "EveUnity UI Toolkit projection capture must contain a root UI node" -} -if (-not (@($projection.root.classNames) -contains "eve-component")) { - throw "EveUnity UI Toolkit projection capture root missing eve-component class" -} - -Write-Host "EveUnity UI Toolkit capture smoke passed: $absoluteOutputPath" diff --git a/scripts/run-parity-harness.ps1 b/scripts/run-parity-harness.ps1 index 0eff372..1a0e836 100644 --- a/scripts/run-parity-harness.ps1 +++ b/scripts/run-parity-harness.ps1 @@ -26,16 +26,7 @@ try { -OutputPath "artifacts\web-reference-layout-probe\latest\eve-world-smoke.json" ` -Port 8894 ` -SkipBuild - & (Join-Path $PSScriptRoot "run-eveunity-uitoolkit-capture-smoke.ps1") - & (Join-Path $PSScriptRoot "run-eveunity-uitoolkit-capture-smoke.ps1") ` - -AdvertisementPath "web\fixtures\eve-world-smoke.provider-advertisement.json" ` - -SurfacePath "web\fixtures\eve-world-smoke-surface.json" ` - -OutputPath "artifacts\eveunity-uitoolkit-capture\latest\eve-world-smoke-unity-uitoolkit-projection.json" ` - -RequestOutputPath "artifacts\eveunity-uitoolkit-capture\latest\eve-world-smoke-capture-request.json" ` - -ExpectedProviderId "eve.world-smoke" ` - -ExpectedSurfaceId "eve.world-smoke.surface" ` - -ExpectedCommandBoundary "eve.world-smoke.commands" ` - -ExpectedReceiptSchema "eve.world_smoke.command_receipt.v1" + & (Join-Path $PSScriptRoot "run-eveunity-owner-smoke.ps1") & (Join-Path $PSScriptRoot "run-evetui-capture-smoke.ps1") & (Join-Path $PSScriptRoot "run-evetui-capture-smoke.ps1") ` -AdvertisementPath "web\fixtures\eve-world-smoke.provider-advertisement.json" ` @@ -56,8 +47,6 @@ try { & (Join-Path $PSScriptRoot "run-eveconformance-handoff-smoke.ps1") & (Join-Path $PSScriptRoot "run-plugin-handoff-smoke.ps1") & (Join-Path $PSScriptRoot "run-aetheria-provider-handoff-smoke.ps1") - & (Join-Path $PSScriptRoot "run-eveunity-split-handoff-smoke.ps1") - & (Join-Path $PSScriptRoot "run-eveunity-release-artifact-smoke.ps1") & (Join-Path $PSScriptRoot "run-eveelectron-owner-smoke.ps1") & (Join-Path $PSScriptRoot "run-evetui-split-handoff-smoke.ps1") & (Join-Path $PSScriptRoot "run-evetui-lifecycle-smoke.ps1") diff --git a/scripts/run-runtime-owner-conformance-consumer-smoke.ps1 b/scripts/run-runtime-owner-conformance-consumer-smoke.ps1 index c25b491..6e062d9 100644 --- a/scripts/run-runtime-owner-conformance-consumer-smoke.ps1 +++ b/scripts/run-runtime-owner-conformance-consumer-smoke.ps1 @@ -150,7 +150,6 @@ node $consumerScript $consumerExport ` --expect-provider-runtime-plugin-projection gamecult.home.vn:sai.visual_novel.surface:tui:sai.vn:supported:EveTui ` --expect-provider-runtime-plugin-projection gamecult.home.vn:sai.visual_novel.surface:tui:norn.graph:optional-supported:EveTui ` --expect-provider-runtime-plugin-projection gamecult.home.vn:sai.visual_novel.surface:tui:tex.math:optional-supported:EveTui ` - --expect-runtime-handoff unity-uitoolkit ` --expect-runtime-command-schema web:gamecult.eve.command_invocation.v1 ` --expect-runtime-command-schema windows-flutter:gamecult.eve.command_invocation.v1 ` --expect-runtime-command-schema unity-uitoolkit:gamecult.eve.command_invocation.v1 ` @@ -161,9 +160,7 @@ node $consumerScript $consumerExport ` --expect-runtime-capture-status windows-flutter:golden ` --expect-runtime-capture-status linux-flutter:ssh-golden ` --expect-runtime-capture-status android-flutter:adb-png ` - --expect-runtime-capture-status unity-uitoolkit:json-projection ` - --expect-runtime-capture-artifact unity-uitoolkit:json-projection:gamecult.eve.unity_uitoolkit_projection.v1:aetheria:aetheria.daemon.game ` - --expect-runtime-capture-artifact unity-uitoolkit:json-projection:gamecult.eve.unity_uitoolkit_projection.v1:eve.world-smoke:eve.world-smoke.surface ` + --expect-runtime-capture-status unity-uitoolkit:pending-native-capture ` --expect-runtime-capture-status unity-scene:partial-world-smoke-playmode-capture ` --expect-runtime-capture-status electron-shell:owner-window-png ` --expect-runtime-capture-artifact electron-shell:png:image/png:eve.world-smoke:eve.world-smoke.surface ` @@ -172,7 +169,7 @@ node $consumerScript $consumerExport ` --expect-runtime-capture-artifact tui:json-grid:gamecult.eve.tui_grid.v1:aetheria:aetheria.daemon.game ` --expect-runtime-capture-artifact tui:json-grid:gamecult.eve.tui_grid.v1:eve.world-smoke:eve.world-smoke.surface ` --expect-runtime-capture-status direct2d:missing ` - --expect-runtime-capture-probe unity-uitoolkit:semantic-artifact-present-capture-pending:png:EveUnity ` + --expect-runtime-capture-probe unity-uitoolkit:contract-artifact-missing:png:EveUnity ` --expect-runtime-capture-probe unity-scene:control-artifact-present-product-capture-pending:png:EveUnity ` --expect-runtime-capture-probe electron-shell:contract-artifact-present:png:EveElectron ` --expect-runtime-witness electron-shell:eve.world-smoke:eve.world-smoke.surface:cold:pass ` @@ -196,21 +193,21 @@ node $consumerScript $consumerExport ` --expect-runtime-lifecycle-status unity-uitoolkit:test:batchmode-editmode-tests-and-consumer-build-smoke ` --expect-runtime-lifecycle-status unity-uitoolkit:capture:pending-editor-capture ` --expect-runtime-lifecycle-pending "unity-uitoolkit:release:Tagged UPM release" ` - --expect-runtime-lifecycle-pending "unity-uitoolkit:test:Unity batchmode EditMode runner" ` + --expect-runtime-lifecycle-pending "unity-uitoolkit:test:Cut and publish the first tagged EveUnity UI Toolkit package release" ` --expect-runtime-lifecycle-pending "unity-uitoolkit:capture:Unity batchmode or editor capture artifact" ` --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.packageName:org.gamecult.eve.unity-uitoolkit" ` --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.artifactKind:upm-package" ` --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.requestSchema:gamecult.eve.runtime_release_request.v1" ` - --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.requestBuilder:tools/eveunity/eveunity-release-contract.mjs" ` - --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.artifactBuilder:tools/eveunity/eveunity-release-artifact.mjs" ` + --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.requestBuilder:scripts/pack-uitoolkit.ps1" ` + --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.artifactBuilder:scripts/pack-uitoolkit.ps1" ` --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.artifactPattern:artifacts/eveunity-uitoolkit-release/{version}/org.gamecult.eve.unity-uitoolkit-{version}.tgz" ` --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.tagPattern:eveunity-uitoolkit-v{version}" ` --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.packageRoot:packages/org.gamecult.eve.unity-uitoolkit" ` --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.requiredPackageDependencies.0.packageName:org.gamecult.eve.surface" ` - --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.requiredPackageDependencies.0.ownerRepo:Eve" ` + --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.requiredPackageDependencies.0.ownerRepo:EveUnity" ` --expect-runtime-lifecycle-field "unity-uitoolkit:release:releaseContract.requiredPackageDependencies.0.packageManager:upm" ` --expect-runtime-lifecycle-field "unity-uitoolkit:test:testContract.runnerKind:unity-editmode-batchmode" ` - --expect-runtime-lifecycle-field "unity-uitoolkit:test:testContract.runnerScript:scripts/run-aetheria-unity-editmode-tests.ps1" ` + --expect-runtime-lifecycle-field "unity-uitoolkit:test:testContract.runnerScript:scripts/run-uitoolkit-tests.ps1" ` --expect-runtime-lifecycle-field "unity-uitoolkit:test:testContract.packageName:org.gamecult.eve.unity-uitoolkit" ` --expect-runtime-lifecycle-field "unity-uitoolkit:test:testContract.testAssembly:GameCult.Eve.UnityUIToolkit.Tests" ` --expect-runtime-lifecycle-field "unity-uitoolkit:test:testContract.testPlatform:EditMode" ` @@ -227,7 +224,7 @@ node $consumerScript $consumerExport ` --expect-runtime-lifecycle-field "unity-uitoolkit:capture:captureContract.artifactKind:png" ` --expect-runtime-lifecycle-field "unity-uitoolkit:capture:captureContract.targetId:unity-uitoolkit" ` --expect-runtime-lifecycle-field "unity-uitoolkit:capture:captureContract.requestSchema:gamecult.eve.runtime_capture_request.v1" ` - --expect-runtime-lifecycle-field "unity-uitoolkit:capture:captureContract.requestBuilder:tools/eveunity/eveunity-capture-contract.mjs" ` + --expect-runtime-lifecycle-field "unity-uitoolkit:capture:captureContract.requestBuilder:scripts/build-uitoolkit-capture-request.ps1" ` --expect-runtime-lifecycle-field "unity-uitoolkit:capture:captureContract.advertisementPath:web/fixtures/aetheria.provider-advertisement.json" ` --expect-runtime-lifecycle-field "unity-uitoolkit:capture:captureContract.conformanceAttachment:runtime.captureArtifacts[]" ` --expect-runtime-lifecycle-field "unity-uitoolkit:capture:captureContract.requiredProvider:aetheria" ` @@ -251,7 +248,7 @@ node $consumerScript $consumerExport ` --expect-runtime-lifecycle-field "unity-scene:release:releaseContract.artifactBuilder:scripts/pack.ps1" ` --expect-runtime-lifecycle-field "unity-scene:release:releaseContract.artifactPattern:artifacts/eveunity-scene-release/{version}/org.gamecult.eve.unity-scene-{version}.tgz" ` --expect-runtime-lifecycle-field "unity-scene:release:releaseContract.requiredPackageDependencies.0.packageName:org.gamecult.eve.surface" ` - --expect-runtime-lifecycle-field "unity-scene:release:releaseContract.requiredPackageDependencies.0.ownerRepo:Eve" ` + --expect-runtime-lifecycle-field "unity-scene:release:releaseContract.requiredPackageDependencies.0.ownerRepo:EveUnity" ` --expect-runtime-lifecycle-field "unity-scene:release:releaseContract.requiredPackageDependencies.0.packageManager:upm" ` --expect-runtime-lifecycle-field "unity-scene:test:testContract.runnerKind:unity-editmode-batchmode" ` --expect-runtime-lifecycle-field "unity-scene:test:testContract.runnerScript:scripts/run-package-tests.ps1" ` diff --git a/scripts/run-split-target-conformance-consumer-smoke.ps1 b/scripts/run-split-target-conformance-consumer-smoke.ps1 index 64a2df2..81cf265 100644 --- a/scripts/run-split-target-conformance-consumer-smoke.ps1 +++ b/scripts/run-split-target-conformance-consumer-smoke.ps1 @@ -39,16 +39,11 @@ try { --expect-split-target-blocker "EveFlutter:Tagged EveFlutter release" ` --expect-split-target EveUnity ` --expect-split-target-status EveUnity:incubating ` - --expect-split-target-proof "EveUnity:Unity lifecycle evidence is declared" ` - --expect-split-target-proof "EveUnity:EveUnity split handoff is machine-readable" ` + --expect-split-target-proof "EveUnity:Unity UI Toolkit package lifecycle is owned and tested from EveUnity" ` + --expect-split-target-proof "EveUnity:Aetheria consumes Unity surface and UI Toolkit packages from EveUnity" ` --expect-split-target-proof "EveUnity:Unity scene runtime is owned by EveUnity" ` --expect-split-target-proof "EveUnity:Unity scene lifecycle is owned and tested from EveUnity" ` --expect-split-target-proof "EveUnity:Aetheria daemon 3D ARPG world lowers through a generic EveUnity playable-world client" ` - --expect-runtime-capture-artifact unity-uitoolkit:json-projection:gamecult.eve.unity_uitoolkit_projection.v1:aetheria:aetheria.daemon.game ` - --expect-runtime-capture-artifact unity-uitoolkit:json-projection:gamecult.eve.unity_uitoolkit_projection.v1:eve.world-smoke:eve.world-smoke.surface ` - --expect-split-handoff-move EveUnity:unity-uitoolkit:aetheria-unity-consumer-boundary:observed-provider:exists:Packages/manifest.json ` - --expect-split-handoff-move EveUnity:unity-uitoolkit:aetheria-unity-consumer-boundary:observed-provider:exists:GameCult.Eve.UnityUIToolkit.csproj ` - --expect-split-handoff-move EveUnity:unity-uitoolkit:aetheria-unity-consumer-boundary:observed-provider:exists:Aetheria.State.Unity/AetheriaRuntimeCatalogClient.cs ` --expect-split-target-blocker "EveUnity:Tagged UPM release" ` --expect-split-target EveElectron ` --expect-split-target-status EveElectron:graduated ` diff --git a/tools/parity/parity-manifest.json b/tools/parity/parity-manifest.json index 7dc60d3..40b05c1 100644 --- a/tools/parity/parity-manifest.json +++ b/tools/parity/parity-manifest.json @@ -622,14 +622,14 @@ ], "proofs": [ { - "description": "Unity lifecycle evidence is declared and smoke-checked for EveUnity incubation.", + "description": "Unity UI Toolkit package lifecycle is owned and tested from EveUnity.", "status": "passed", - "evidencePaths": ["packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json", "scripts/run-eveunity-lifecycle-smoke.ps1", "scripts/run-aetheria-unity-package-smoke.ps1", "scripts/run-aetheria-unity-editmode-tests.ps1"] + "evidencePaths": ["../EveUnity/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json", "../EveUnity/scripts/pack-uitoolkit.ps1", "../EveUnity/scripts/run-uitoolkit-tests.ps1"] }, { - "description": "EveUnity split handoff is machine-readable and smoke-checked.", + "description": "Aetheria consumes Unity surface and UI Toolkit packages from EveUnity.", "status": "passed", - "evidencePaths": ["packages/org.gamecult.eve.unity-uitoolkit/eveunity-split-handoff.json", "scripts/run-eveunity-split-handoff-smoke.ps1", "packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json"] + "evidencePaths": ["../EveUnity/packages/org.gamecult.eve.surface/package.json", "../EveUnity/packages/org.gamecult.eve.unity-uitoolkit/package.json", "../Aetheria/Packages/manifest.json"] }, { "description": "Unity scene runtime is owned by EveUnity and its owner-repo sources are present.", @@ -1124,7 +1124,7 @@ "packageName": "org.gamecult.eve.surface", "version": "0.1.0", "packageManager": "upm", - "ownerRepo": "Eve", + "ownerRepo": "EveUnity", "purpose": "Shared Unity DTOs for gamecult.eve.surface.v1 documents." } ] @@ -1562,10 +1562,12 @@ "id": "unity-uitoolkit", "title": "Unity / UI Toolkit", "kind": "active", - "ownerRepo": "Eve", - "repoRole": "runtime-incubating", + "ownerRepo": "EveUnity", + "repoRole": "runtime-target", "splitTarget": "EveUnity", - "graduationTrigger": "Split when Unity package has independent UPM release, plugin projection adapter behavior, and Unity test/capture lifecycle.", + "graduationTrigger": "Graduated: EveUnity owns the UI Toolkit package, plugin projection adapters, package build, and Unity tests.", + "sourceRoot": "../EveUnity", + "currentHostRepo": "EveUnity", "capabilityManifest": { "schemaPath": "schemas/gamecult.eve.runtime_capability.v1.schema.json", "manifestPath": "packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json" @@ -1598,8 +1600,8 @@ "evidencePaths": [ "packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceLowerer.cs", "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs", - "web/fixtures/aetheria.provider-advertisement.json", - "web/fixtures/eve-world-smoke.provider-advertisement.json" + "../Eve/web/fixtures/aetheria.provider-advertisement.json", + "../Eve/web/fixtures/eve-world-smoke.provider-advertisement.json" ] } ], @@ -1611,12 +1613,9 @@ "packages/org.gamecult.eve.unity-uitoolkit/Runtime/TeXMathUiToolkitProjectionAdapter.cs", "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef", "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs", - "packages/org.gamecult.eve.unity-uitoolkit/eveunity-split-handoff.json", - "scripts/run-aetheria-unity-editmode-tests.ps1", - "scripts/run-eveunity-split-handoff-smoke.ps1", - "scripts/run-eveunity-uitoolkit-capture-smoke.ps1", - "tools/eveunity/eveunity-uitoolkit-capture-artifact.mjs", - "tools/eveunity/eveunity-uitoolkit-capture-artifact.test.mjs" + "packages/org.gamecult.eve.surface/Runtime/EveSurfaceDocument.cs", + "scripts/pack-uitoolkit.ps1", + "scripts/run-uitoolkit-tests.ps1" ], "expectedSourceSymbols": [ { @@ -1642,29 +1641,21 @@ { "path": "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs", "contains": ["FindPluginProjectionAdapter", "SaiStageLowersThroughRuntimeProjectionAdapter", "NornGraphLowersThroughRuntimeProjectionAdapter", "TeXMathLowersThroughRuntimeProjectionAdapterAsSourceFallback", "EmbeddedDocumentSlotMountsResolverBackedChildSurface", "eve-plugin-projection"] - }, - { - "path": "tools/eveunity/eveunity-uitoolkit-capture-artifact.mjs", - "contains": ["buildUnityUiToolkitCaptureArtifact", "buildUnityUiToolkitProjection", "gamecult.eve.unity_uitoolkit_projection.v1", "unity-uitoolkit-projection-json", "writeUnityUiToolkitCaptureArtifact", "request-output"] - }, - { - "path": "tools/eveunity/eveunity-uitoolkit-capture-artifact.test.mjs", - "contains": ["builds Unity UI Toolkit projection capture artifact", "builds Unity UI Toolkit capture artifact for a generic world provider", "marks Sai required and Norn TeX optional sidecar plugin UI projections", "gamecult.eve.unity_uitoolkit_projection.v1", "unity-uitoolkit-projection-json", "optional-nested", "eve.world-smoke.commands"] } ], "commandTransportSmoke": { "schema": "gamecult.eve.command_invocation.v1", "expectedPaths": [ - "packages/org.gamecult.eve.surface/Runtime/EveSurfaceDocument.cs", - "packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceLowerer.cs" + "../EveUnity/packages/org.gamecult.eve.surface/Runtime/EveSurfaceDocument.cs", + "../EveUnity/packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceLowerer.cs" ], "expectedSourceSymbols": [ { - "path": "packages/org.gamecult.eve.surface/Runtime/EveSurfaceDocument.cs", + "path": "../EveUnity/packages/org.gamecult.eve.surface/Runtime/EveSurfaceDocument.cs", "contains": ["EveSurfaceCommandRequest", "SchemaId", "gamecult.eve.command_invocation.v1", "ClientId"] }, { - "path": "packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceLowerer.cs", + "path": "../EveUnity/packages/org.gamecult.eve.unity-uitoolkit/Runtime/EveUiToolkitSurfaceLowerer.cs", "contains": ["commandSink", "EmitCommand", "ResolveOperation", "unity-uitoolkit"] } ] @@ -1681,8 +1672,8 @@ "tagPattern": "eveunity-uitoolkit-v{version}", "artifactKind": "upm-package", "requestSchema": "gamecult.eve.runtime_release_request.v1", - "requestBuilder": "tools/eveunity/eveunity-release-contract.mjs", - "artifactBuilder": "tools/eveunity/eveunity-release-artifact.mjs", + "requestBuilder": "scripts/pack-uitoolkit.ps1", + "artifactBuilder": "scripts/pack-uitoolkit.ps1", "artifactPattern": "artifacts/eveunity-uitoolkit-release/{version}/org.gamecult.eve.unity-uitoolkit-{version}.tgz", "publishProof": "Tagged UPM release is created from the EveUnity repo and references this package root.", "requiredPackageDependencies": [ @@ -1690,7 +1681,7 @@ "packageName": "org.gamecult.eve.surface", "version": "0.1.0", "packageManager": "upm", - "ownerRepo": "Eve", + "ownerRepo": "EveUnity", "purpose": "Shared Unity DTOs for gamecult.eve.surface.v1 documents." } ] @@ -1698,13 +1689,7 @@ "evidencePaths": [ "packages/org.gamecult.eve.unity-uitoolkit/package.json", "packages/org.gamecult.eve.unity-uitoolkit/README.md", - "tools/eveunity/eveunity-release-contract.mjs", - "tools/eveunity/eveunity-release-contract.test.mjs", - "tools/eveunity/eveunity-release-artifact.mjs", - "tools/eveunity/eveunity-release-artifact.test.mjs", - "scripts/run-eveunity-release-contract-smoke.ps1", - "scripts/run-eveunity-release-artifact-smoke.ps1", - "scripts/run-aetheria-unity-package-smoke.ps1" + "scripts/pack-uitoolkit.ps1" ], "pendingProofs": [ "Tagged UPM release cut from EveUnity rather than Eve incubation." @@ -1713,11 +1698,11 @@ "test": { "ownerRepo": "EveUnity", "status": "batchmode-editmode-tests-and-consumer-build-smoke", - "command": "powershell -ExecutionPolicy Bypass -File .\\scripts\\run-aetheria-unity-editmode-tests.ps1", + "command": "powershell -ExecutionPolicy Bypass -File .\\scripts\\run-uitoolkit-tests.ps1", "testContract": { "ownerRepo": "EveUnity", "runnerKind": "unity-editmode-batchmode", - "runnerScript": "scripts/run-aetheria-unity-editmode-tests.ps1", + "runnerScript": "scripts/run-uitoolkit-tests.ps1", "consumerProject": "E:\\Projects\\Aetheria", "unityExeDefault": "C:\\Program Files\\Unity\\Hub\\Editor\\6000.4.2f1\\Editor\\Unity.exe", "packageName": "org.gamecult.eve.unity-uitoolkit", @@ -1780,13 +1765,10 @@ "evidencePaths": [ "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/GameCult.Eve.UnityUIToolkit.Tests.asmdef", "packages/org.gamecult.eve.unity-uitoolkit/Tests/Editor/EveUiToolkitSurfaceLowererTests.cs", - "scripts/run-aetheria-unity-editmode-tests.ps1", - "scripts/run-aetheria-unity-package-smoke.ps1", - "scripts/run-eveunity-split-handoff-smoke.ps1", - "packages/org.gamecult.eve.unity-uitoolkit/eveunity-split-handoff.json" + "scripts/run-uitoolkit-tests.ps1" ], "pendingProofs": [ - "Unity batchmode EditMode runner is owned by EveUnity rather than Eve incubation." + "Cut and publish the first tagged EveUnity UI Toolkit package release." ] }, "capture": { @@ -1797,7 +1779,7 @@ "runtimeId": "unity-uitoolkit", "targetId": "unity-uitoolkit", "requestSchema": "gamecult.eve.runtime_capture_request.v1", - "requestBuilder": "tools/eveunity/eveunity-capture-contract.mjs", + "requestBuilder": "scripts/build-uitoolkit-capture-request.ps1", "advertisementPath": "web/fixtures/aetheria.provider-advertisement.json", "captureKind": "unity-editor-or-batchmode-png", "artifactKind": "png", @@ -1821,13 +1803,8 @@ "publishProof": "Unity editor or batchmode capture artifact is attached to the runtime conformance report from EveUnity." }, "evidencePaths": [ - "tools/eveunity/eveunity-capture-contract.mjs", - "tools/eveunity/eveunity-capture-contract.test.mjs", - "scripts/run-eveunity-capture-contract-smoke.ps1", - "tools/eveunity/eveunity-uitoolkit-capture-artifact.mjs", - "tools/eveunity/eveunity-uitoolkit-capture-artifact.test.mjs", - "scripts/run-eveunity-uitoolkit-capture-smoke.ps1", - "web/fixtures/aetheria.provider-advertisement.json" + "packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json", + "scripts/build-uitoolkit-capture-request.ps1" ], "pendingProofs": [ "Unity batchmode or editor capture artifact attached to the runtime conformance report." @@ -1835,30 +1812,9 @@ } }, "capture": { - "status": "json-projection", - "note": "Unity UI Toolkit attaches a provider-advertisement-backed gamecult.eve.unity_uitoolkit_projection.v1 JSON projection artifact; Unity editor or batchmode PNG capture remains an EveUnity split blocker.", - "artifacts": [ - { - "kind": "json-projection", - "schema": "gamecult.eve.unity_uitoolkit_projection.v1", - "path": "artifacts/eveunity-uitoolkit-capture/latest/unity-uitoolkit-projection.json", - "runtimeId": "unity-uitoolkit", - "providerId": "aetheria", - "surfaceId": "aetheria.daemon.game", - "sourceSurfacePath": "web/fixtures/aetheria-world-surface.json", - "requestPath": "artifacts/eveunity-uitoolkit-capture/latest/capture-request.json" - }, - { - "kind": "json-projection", - "schema": "gamecult.eve.unity_uitoolkit_projection.v1", - "path": "artifacts/eveunity-uitoolkit-capture/latest/eve-world-smoke-unity-uitoolkit-projection.json", - "runtimeId": "unity-uitoolkit", - "providerId": "eve.world-smoke", - "surfaceId": "eve.world-smoke.surface", - "sourceSurfacePath": "web/fixtures/eve-world-smoke-surface.json", - "requestPath": "artifacts/eveunity-uitoolkit-capture/latest/eve-world-smoke-capture-request.json" - } - ] + "status": "pending-native-capture", + "note": "Unity editor or batchmode PNG capture must be produced and attached by EveUnity; Eve does not manufacture a runtime proxy artifact.", + "artifacts": [] } }, {