From b1ed4c470d2069bd70a9be35596241c17ca12fe0 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 10 Jul 2026 08:20:17 +0100 Subject: [PATCH] Add UI Toolkit capture request contract --- .../eve-runtime-capability.json | 3 +- scripts/build-uitoolkit-capture-request.ps1 | 43 +++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 scripts/build-uitoolkit-capture-request.ps1 diff --git a/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json b/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json index 53b164d..bfa97bb 100644 --- a/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json +++ b/packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.json @@ -207,7 +207,8 @@ "publishProof": "Unity editor or batchmode capture artifact is attached to the runtime conformance report from EveUnity." }, "evidencePaths": [ - "packages/org.gamecult.eve.unity-uitoolkit/eve-runtime-capability.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." diff --git a/scripts/build-uitoolkit-capture-request.ps1 b/scripts/build-uitoolkit-capture-request.ps1 new file mode 100644 index 0000000..32089ff --- /dev/null +++ b/scripts/build-uitoolkit-capture-request.ps1 @@ -0,0 +1,43 @@ +param( + [Parameter(Mandatory = $true)] + [string] $AdvertisementPath, + [string] $SurfaceId = "", + [string] $OutputPath = "artifacts\uitoolkit-capture\request.json", + [string] $Stamp = "latest" +) + +$ErrorActionPreference = "Stop" +$repoRoot = Split-Path -Parent $PSScriptRoot +$capabilityPath = Join-Path $repoRoot "packages\org.gamecult.eve.unity-uitoolkit\eve-runtime-capability.json" +$capability = Get-Content -Raw $capabilityPath | ConvertFrom-Json +$advertisement = Get-Content -Raw $AdvertisementPath | ConvertFrom-Json +$contract = $capability.lifecycle.capture.captureContract +$surface = @($advertisement.surfaces) | Where-Object { + ([string]::IsNullOrWhiteSpace($SurfaceId) -or $_.surfaceId -eq $SurfaceId) -and + @($_.worldInteraction.loweringTargets) -contains $contract.targetId +} | Select-Object -First 1 + +if ($null -eq $surface) { + throw "Provider does not advertise a $($contract.targetId) surface: $SurfaceId" +} + +$absoluteOutput = if ([IO.Path]::IsPathRooted($OutputPath)) { $OutputPath } else { Join-Path $repoRoot $OutputPath } +$request = [ordered]@{ + schema = $contract.requestSchema + ownerRepo = $contract.ownerRepo + runtimeId = $contract.runtimeId + targetId = $contract.targetId + providerId = $advertisement.providerId + surfaceId = $surface.surfaceId + projectionKind = $surface.worldInteraction.projectionKind + commandBoundary = $surface.worldInteraction.commandBoundary + receiptSchema = $surface.worldInteraction.receiptSchema + captureKind = $contract.captureKind + artifactKind = $contract.artifactKind + artifactPath = $contract.artifactPattern.Replace('{stamp}', $Stamp) + sourceAdvertisementPath = $AdvertisementPath +} + +New-Item -ItemType Directory -Force -Path (Split-Path -Parent $absoluteOutput) | Out-Null +$request | ConvertTo-Json -Depth 16 | Set-Content -LiteralPath $absoluteOutput +Write-Host $absoluteOutput