#pragma once

#include "CoreMinimal.h"
#include "HyperTwistCore/HyperTwistCoreTypes.h"
#include "HyperTwistRecognitionTypes.generated.h"

UENUM(BlueprintType)
enum class EHyperTwistVisionCaptureMode : uint8
{
	LiveCamera UMETA(DisplayName = "Live Camera"),
	BatchVideo UMETA(DisplayName = "Batch Video")
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionCalibrationSwatch
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ColorId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Notation;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FIntVector ReferenceBgr = FIntVector::ZeroValue;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FVector ReferenceLab = FVector::ZeroVector;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUserCalibrated = false;

	bool IsStructurallyValid() const
	{
		return !ColorId.IsEmpty() && !Notation.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionCalibrationProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PuzzleId = TEXT("cube/3x3x3");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DominantColorMethod = TEXT("kmeans-1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ColorDistanceMethod = TEXT("ciede2000");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPersistsPerUserPalette = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionCalibrationSwatch> PaletteSwatches;

	bool IsStructurallyValid() const
	{
		if (ProfileId.IsEmpty() || PuzzleId.IsEmpty() || PaletteSwatches.Num() < 6)
		{
			return false;
		}

		for (const FHyperTwistVisionCalibrationSwatch& Swatch : PaletteSwatches)
		{
			if (!Swatch.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionObservedSticker
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 GridIndex = -1;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 GridRow = -1;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 GridColumn = -1;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ColorId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Notation;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FIntVector SampleBgr = FIntVector::ZeroValue;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float Confidence = 0.0f;

	bool IsStructurallyValid() const
	{
		return GridIndex >= 0
			&& GridRow >= 0
			&& GridColumn >= 0
			&& !ColorId.IsEmpty()
			&& !Notation.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionFaceObservation
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ObservationId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OrderingProfile = TEXT("3x3-row-major");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 CandidateContourCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 AcceptedContourCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bFoundStableThreeByThreeGrid = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bOrderingStable = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bCommitReady = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionObservedSticker> OrderedStickers;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> NormalizationWarnings;

	bool IsStructurallyValid() const
	{
		if (ObservationId.IsEmpty()
			|| FaceId.IsEmpty()
			|| OrderedStickers.Num() != 9
			|| !bFoundStableThreeByThreeGrid
			|| !bOrderingStable)
		{
			return false;
		}

		for (const FHyperTwistVisionObservedSticker& Sticker : OrderedStickers)
		{
			if (!Sticker.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionStickerVoteTally
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Notation;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ColorId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 VoteCount = 0;

	bool IsStructurallyValid() const
	{
		return !Notation.IsEmpty() && !ColorId.IsEmpty() && VoteCount > 0;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionReconstructionStickerVote
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 GridIndex = -1;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 GridRow = -1;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 GridColumn = -1;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString WinningNotation;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString WinningColorId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 WinningVoteCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 TotalVoteCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bHadConflict = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionStickerVoteTally> Tallies;

	bool IsStructurallyValid() const
	{
		if (GridIndex < 0
			|| GridRow < 0
			|| GridColumn < 0
			|| WinningNotation.IsEmpty()
			|| WinningColorId.IsEmpty()
			|| WinningVoteCount <= 0
			|| TotalVoteCount <= 0
			|| Tallies.Num() <= 0)
		{
			return false;
		}

		for (const FHyperTwistVisionStickerVoteTally& Tally : Tallies)
		{
			if (!Tally.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionCommittedFaceState
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestObservationId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OrderingProfile = TEXT("3x3-row-major");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ObservationCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RevisionCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bHasConflicts = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionObservedSticker> LatestOrderedStickers;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionReconstructionStickerVote> StickerVotes;

	bool IsStructurallyValid() const
	{
		if (FaceId.IsEmpty()
			|| LatestObservationId.IsEmpty()
			|| LatestOrderedStickers.Num() != 9
			|| StickerVotes.Num() != 9
			|| ObservationCount <= 0
			|| RevisionCount < 0)
		{
			return false;
		}

		for (const FHyperTwistVisionObservedSticker& Sticker : LatestOrderedStickers)
		{
			if (!Sticker.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistVisionReconstructionStickerVote& Vote : StickerVotes)
		{
			if (!Vote.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionReconstructionSession
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PuzzleId = TEXT("cube/3x3x3");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReconstructionProfile = TEXT("classic-face-vote-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OrientationProfile = TEXT("classic-target-face-net-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUsesObservationVoting = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bHasStableOrientation = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 OrientationStateOrdinal = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 TotalCommittedFaceCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 TotalRevisionCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float ConfidenceRollup = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bHasCompleteClassicCubeNet = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionCommittedFaceState> CommittedFaces;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> MissingFaces;

	bool IsStructurallyValid() const
	{
		if (SessionId.IsEmpty() || PuzzleId.IsEmpty() || ReconstructionProfile.IsEmpty() || OrientationProfile.IsEmpty())
		{
			return false;
		}

		for (const FHyperTwistVisionCommittedFaceState& Face : CommittedFaces)
		{
			if (!Face.IsStructurallyValid())
			{
				return false;
			}
		}

		return TotalCommittedFaceCount >= 0 && TotalRevisionCount >= 0;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionShellActionBinding
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString InputBinding;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SurfaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEnabled = true;

	bool IsStructurallyValid() const
	{
		return !ActionId.IsEmpty() && !InputBinding.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionShellPanelLayout
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PanelId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PanelKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AnchorId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 GridRows = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 GridColumns = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bVisibleByDefault = true;

	bool IsStructurallyValid() const
	{
		return !PanelId.IsEmpty() && !PanelKind.IsEmpty() && !AnchorId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionFontReviewDescriptor
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FontReviewDescriptorId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LocaleCode;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FontFamilyId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ScriptCoverageProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReviewDocumentPath;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AcquisitionMode = TEXT("user-supplied-or-platform-provided");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReviewPosture = TEXT("per-font-license-review-required");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bBundledWithCodeDistribution = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bStandaloneDonorRenderingDeferred = true;

	bool IsStructurallyValid() const
	{
		return !FontReviewDescriptorId.IsEmpty()
			&& !LocaleCode.IsEmpty()
			&& !FontFamilyId.IsEmpty()
			&& !ScriptCoverageProfileId.IsEmpty()
			&& !ReviewDocumentPath.IsEmpty()
			&& !AcquisitionMode.IsEmpty()
			&& !ReviewPosture.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionFontReviewProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FontReviewProfileId = TEXT("qbr-bundled-font-review-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReviewPosture = TEXT("independent-font-license-review-required");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ShippingPosture = TEXT("not-shipped-in-packet");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProvisioningPosture = TEXT("user-supplied-or-platform-provided");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CodeLicenseBoundary = TEXT("code-license-reviewed-separately");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresIndependentFontLicenseReview = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowsBundledFontRedistribution = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowsRuntimeFontDownloadInCurrentPacket = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresComplexScriptCoverageVerification = true;

	bool IsStructurallyValid() const
	{
		return !FontReviewProfileId.IsEmpty()
			&& !ReviewPosture.IsEmpty()
			&& !ShippingPosture.IsEmpty()
			&& !ProvisioningPosture.IsEmpty()
			&& !CodeLicenseBoundary.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionLocaleOption
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LocaleCode;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DisplayLabel;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString GuidanceModeId = TEXT("qbr-locale-guidance-routing-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ScriptDirectionId = TEXT("ltr");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TextFlowProfileId = TEXT("word-space-delimited");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PresentationProfileId = TEXT("qbr-locale-presentation-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FontReviewDescriptorId = TEXT("font-review/qbr/latin-core");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresComplexTextShaping = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bBundledFontAssetDeferred = true;

	bool IsStructurallyValid() const
	{
		return !LocaleCode.IsEmpty()
			&& !DisplayLabel.IsEmpty()
			&& !GuidanceModeId.IsEmpty()
			&& !ScriptDirectionId.IsEmpty()
			&& !TextFlowProfileId.IsEmpty()
			&& !PresentationProfileId.IsEmpty()
			&& !FontReviewDescriptorId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionShellProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ShellProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ShellKind = TEXT("webcam-overlay");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LocaleRoutingMode = TEXT("first-party-locale-cycle");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DefaultLocaleCode = TEXT("en");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FontReviewProfileId = TEXT("qbr-bundled-font-review-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionFontReviewProfile FontReviewProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionFontReviewDescriptor> SupportedFontReviews;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionLocaleOption> SupportedLocales;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionShellPanelLayout> Panels;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionShellActionBinding> ActionBindings;

	bool IsStructurallyValid() const
	{
		if (ShellProfileId.IsEmpty()
			|| ShellKind.IsEmpty()
			|| DefaultLocaleCode.IsEmpty()
			|| FontReviewProfileId.IsEmpty()
			|| !FontReviewProfileDefinition.IsStructurallyValid()
			|| SupportedFontReviews.Num() <= 0
			|| SupportedLocales.Num() <= 0
			|| Panels.Num() <= 0
			|| ActionBindings.Num() <= 0)
		{
			return false;
		}

		for (const FHyperTwistVisionLocaleOption& LocaleOption : SupportedLocales)
		{
			if (!LocaleOption.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistVisionFontReviewDescriptor& FontReview : SupportedFontReviews)
		{
			if (!FontReview.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistVisionShellPanelLayout& Panel : Panels)
		{
			if (!Panel.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistVisionShellActionBinding& ActionBinding : ActionBindings)
		{
			if (!ActionBinding.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionShellState
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ShellProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LocaleCode = TEXT("en");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LocaleDisplayLabel = TEXT("English");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveLocaleScriptDirectionId = TEXT("ltr");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveLocaleTextFlowProfileId = TEXT("word-space-delimited");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveLocalePresentationProfileId = TEXT("qbr-locale-presentation-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FontReviewProfileId = TEXT("qbr-bundled-font-review-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveFontReviewDescriptorId = TEXT("font-review/qbr/latin-core");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bActiveLocaleRequiresComplexTextShaping = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bBundledFontAssetDeferred = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> AvailableLocaleCodes;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ScannedSideCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 TargetSideCount = 6;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TargetFaceHint;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LastCommittedFaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CalibrationProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreviewPanelVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSnapshotPanelVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bScannedSideCounterVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bCubeNetVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bLocaleIndicatorVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bCalibrationRailVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> CapturedFaceIds;

	bool IsStructurallyValid() const
	{
		return !ShellProfileId.IsEmpty()
			&& !LocaleCode.IsEmpty()
			&& !LocaleDisplayLabel.IsEmpty()
			&& !ActiveLocaleScriptDirectionId.IsEmpty()
			&& !ActiveLocaleTextFlowProfileId.IsEmpty()
			&& !ActiveLocalePresentationProfileId.IsEmpty()
			&& !FontReviewProfileId.IsEmpty()
			&& !ActiveFontReviewDescriptorId.IsEmpty()
			&& !CalibrationProfileId.IsEmpty()
			&& ScannedSideCount >= 0
			&& TargetSideCount > 0
			&& !AvailableLocaleCodes.ContainsByPredicate(
				[](const FString& LocaleCodeValue)
				{
					return LocaleCodeValue.IsEmpty();
				}
			);
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionBrowserAssetReviewDescriptor
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString BrowserAssetReviewDescriptorId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UpstreamComponentId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AssetPathHint;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AssetKind = TEXT("browser-visualization-script");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReviewDocumentPath;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AcquisitionMode = TEXT("user-supplied-or-review-cleared-replacement");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReviewPosture = TEXT("per-asset-license-review-required");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bBundledWithCodeDistribution = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPlaybackVisualizationDeferred = true;

	bool IsStructurallyValid() const
	{
		return !BrowserAssetReviewDescriptorId.IsEmpty()
			&& !UpstreamComponentId.IsEmpty()
			&& !AssetPathHint.IsEmpty()
			&& !AssetKind.IsEmpty()
			&& !ReviewDocumentPath.IsEmpty()
			&& !AcquisitionMode.IsEmpty()
			&& !ReviewPosture.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionBrowserAssetReviewProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString BrowserAssetReviewProfileId = TEXT("rubix-browser-asset-review-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReviewPosture = TEXT("independent-browser-asset-license-review-required");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ShippingPosture = TEXT("not-shipped-in-packet");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProvisioningPosture = TEXT("user-supplied-or-review-cleared-replacement");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CodeLicenseBoundary = TEXT("code-license-reviewed-separately");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresIndependentBrowserAssetReview = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowsBundledBrowserAssetRedistribution = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowsRuntimeBrowserAssetDownloadInCurrentPacket = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPlaybackVisualizationOwnershipDeferred = true;

	bool IsStructurallyValid() const
	{
		return !BrowserAssetReviewProfileId.IsEmpty()
			&& !ReviewPosture.IsEmpty()
			&& !ShippingPosture.IsEmpty()
			&& !ProvisioningPosture.IsEmpty()
			&& !CodeLicenseBoundary.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionBrowserShellProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString BrowserShellProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TransportKind = TEXT("websocket");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TransportEndpoint = TEXT("ws://localhost:8090/");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 CaptureIntervalMs = 100;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsManualCubeEdit = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsPlaybackStage = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString BrowserAssetReviewProfileId = TEXT("rubix-browser-asset-review-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionBrowserAssetReviewProfile BrowserAssetReviewProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DefaultBrowserAssetReviewDescriptorId =
		TEXT("browser-asset-review/rubix-cube-solver/twistysim");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionBrowserAssetReviewDescriptor> SupportedBrowserAssetReviews;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> OrderedStageIds;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionShellActionBinding> ActionBindings;

	bool IsStructurallyValid() const
	{
		if (BrowserShellProfileId.IsEmpty()
			|| TransportKind.IsEmpty()
			|| TransportEndpoint.IsEmpty()
			|| CaptureIntervalMs <= 0
			|| BrowserAssetReviewProfileId.IsEmpty()
			|| !BrowserAssetReviewProfileDefinition.IsStructurallyValid()
			|| DefaultBrowserAssetReviewDescriptorId.IsEmpty()
			|| SupportedBrowserAssetReviews.Num() <= 0
			|| OrderedStageIds.Num() <= 0
			|| ActionBindings.Num() <= 0)
		{
			return false;
		}

		for (const FString& StageId : OrderedStageIds)
		{
			if (StageId.IsEmpty())
			{
				return false;
			}
		}

		for (const FHyperTwistVisionBrowserAssetReviewDescriptor& AssetReview : SupportedBrowserAssetReviews)
		{
			if (!AssetReview.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistVisionShellActionBinding& ActionBinding : ActionBindings)
		{
			if (!ActionBinding.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionBrowserShellState
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString BrowserShellProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveStageId = TEXT("home-page");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TransportKind = TEXT("websocket");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TransportEndpoint = TEXT("ws://localhost:8090/");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 CaptureIntervalMs = 100;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 CubeDimension = 3;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 CommittedFaceCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ExpectedFaceCount = 6;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TargetFaceHint;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bTransportRouteReady = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bVideoStreamVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bManualCubeEditVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bManualCubeEditReady = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPlaybackDeferred = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSnapshotReady = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString BrowserAssetReviewProfileId = TEXT("rubix-browser-asset-review-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveBrowserAssetReviewDescriptorId =
		TEXT("browser-asset-review/rubix-cube-solver/twistysim");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bBundledBrowserAssetDeferred = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSessionRestartVisible = true;

	bool IsStructurallyValid() const
	{
		return !BrowserShellProfileId.IsEmpty()
			&& !ActiveStageId.IsEmpty()
			&& !TransportKind.IsEmpty()
			&& !TransportEndpoint.IsEmpty()
			&& CaptureIntervalMs > 0
			&& !BrowserAssetReviewProfileId.IsEmpty()
			&& !ActiveBrowserAssetReviewDescriptorId.IsEmpty()
			&& CubeDimension > 0
			&& CommittedFaceCount >= 0
			&& ExpectedFaceCount > 0;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionSolveExplanationStep
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StepId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StageId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Title;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Description;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendationLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 StageOrdinal = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPlaybackDeferred = true;

	bool IsStructurallyValid() const
	{
		return !StepId.IsEmpty()
			&& !StageId.IsEmpty()
			&& !Title.IsEmpty()
			&& !Description.IsEmpty()
			&& !RecommendationLine.IsEmpty()
			&& StageOrdinal >= 0;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionSolveExplanationProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExplanationProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PuzzleId = TEXT("cube/3x3x3");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendationMode = TEXT("bounded-stage-ladder-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LocaleGuidanceMode = TEXT("qbr-locale-guidance-routing-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DefaultLocaleCode = TEXT("en");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StartingOrientationHint = TEXT("front: green | top: white");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FontReviewProfileId = TEXT("qbr-bundled-font-review-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionFontReviewProfile FontReviewProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionFontReviewDescriptor> SupportedFontReviews;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsStageRecommendation = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsStepNavigation = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsPlaybackStage = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionLocaleOption> SupportedLocales;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionSolveExplanationStep> Steps;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionShellActionBinding> ActionBindings;

	bool IsStructurallyValid() const
	{
		if (ExplanationProfileId.IsEmpty()
			|| PuzzleId.IsEmpty()
			|| RecommendationMode.IsEmpty()
			|| LocaleGuidanceMode.IsEmpty()
			|| DefaultLocaleCode.IsEmpty()
			|| StartingOrientationHint.IsEmpty()
			|| FontReviewProfileId.IsEmpty()
			|| !FontReviewProfileDefinition.IsStructurallyValid()
			|| SupportedFontReviews.Num() <= 0
			|| SupportedLocales.Num() <= 0
			|| Steps.Num() <= 0
			|| ActionBindings.Num() <= 0)
		{
			return false;
		}

		for (const FHyperTwistVisionLocaleOption& LocaleOption : SupportedLocales)
		{
			if (!LocaleOption.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistVisionFontReviewDescriptor& FontReview : SupportedFontReviews)
		{
			if (!FontReview.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistVisionSolveExplanationStep& Step : Steps)
		{
			if (!Step.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistVisionShellActionBinding& ActionBinding : ActionBindings)
		{
			if (!ActionBinding.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionSolveExplanationState
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExplanationProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendedStageId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendationStatusLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendationDetailLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveLocaleCode = TEXT("en");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveLocaleDisplayLabel = TEXT("English");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveLocaleScriptDirectionId = TEXT("ltr");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveLocaleTextFlowProfileId = TEXT("word-space-delimited");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveLocalePresentationProfileId = TEXT("qbr-locale-presentation-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FontReviewProfileId = TEXT("qbr-bundled-font-review-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveFontReviewDescriptorId = TEXT("font-review/qbr/latin-core");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bActiveLocaleRequiresComplexTextShaping = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bBundledFontAssetDeferred = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LocaleGuidanceMode = TEXT("qbr-locale-guidance-routing-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StartingOrientationHint = TEXT("front: green | top: white");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CurrentStepId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 CurrentStepOrdinal = -1;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 TotalStepCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bReadyForExplanation = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bStartExplanationVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bNextStepVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreviousStepVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPlaybackDeferred = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresFullReconstruction = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bLocaleCycleVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bStartingOrientationHintVisible = true;

	bool IsStructurallyValid() const
	{
		return !ExplanationProfileId.IsEmpty()
			&& !ActiveLocaleCode.IsEmpty()
			&& !ActiveLocaleDisplayLabel.IsEmpty()
			&& !ActiveLocaleScriptDirectionId.IsEmpty()
			&& !ActiveLocaleTextFlowProfileId.IsEmpty()
			&& !ActiveLocalePresentationProfileId.IsEmpty()
			&& !FontReviewProfileId.IsEmpty()
			&& !ActiveFontReviewDescriptorId.IsEmpty()
			&& !LocaleGuidanceMode.IsEmpty()
			&& !StartingOrientationHint.IsEmpty()
			&& CurrentStepOrdinal >= -1
			&& TotalStepCount >= 0;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionCorrectionTarget
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReasonId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendedActionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 PriorityOrdinal = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bManualReviewPreferred = false;

	bool IsStructurallyValid() const
	{
		return !FaceId.IsEmpty()
			&& !ReasonId.IsEmpty()
			&& !RecommendedActionId.IsEmpty()
			&& PriorityOrdinal >= 0;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionCorrectionContradiction
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ContradictionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ContradictionKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ObservationId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RevisionCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<int32> AffectedStickerIndices;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bBlocksSolveExplanation = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bManualReviewPreferred = false;

	bool IsStructurallyValid() const
	{
		return !ContradictionId.IsEmpty()
			&& !FaceId.IsEmpty()
			&& !ContradictionKind.IsEmpty()
			&& RevisionCount >= 0;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionCorrectionResolution
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ResolutionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ResolutionKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RequestedActionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ObservationId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RevisionCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> ResolvedContradictionIds;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bClearsSolveExplanationBlock = false;

	bool IsStructurallyValid() const
	{
		return !ResolutionId.IsEmpty()
			&& !FaceId.IsEmpty()
			&& !ResolutionKind.IsEmpty()
			&& !RequestedActionId.IsEmpty()
			&& RevisionCount >= 0;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionCorrectionProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CorrectionProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PuzzleId = TEXT("cube/3x3x3");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CorrectionMode = TEXT("bounded-multi-face-correction-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsTargetedRescan = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsManualCubeEdit = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsStageRestart = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionShellActionBinding> ActionBindings;

	bool IsStructurallyValid() const
	{
		if (CorrectionProfileId.IsEmpty()
			|| PuzzleId.IsEmpty()
			|| CorrectionMode.IsEmpty()
			|| ActionBindings.Num() <= 0)
		{
			return false;
		}

		for (const FHyperTwistVisionShellActionBinding& ActionBinding : ActionBindings)
		{
			if (!ActionBinding.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionCorrectionState
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CorrectionProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendedStageId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendationStatusLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendationDetailLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString NextRecommendedActionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveTargetFaceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 MissingFaceCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ContradictionCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ResolvedCorrectionCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionCorrectionTarget ActiveTarget;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionCorrectionTarget> PendingTargets;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionCorrectionContradiction> Contradictions;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionCorrectionResolution LastResolution;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVisionCorrectionResolution> ResolutionLedger;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bCorrectionRequired = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bManualReviewRequired = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bTargetedRescanVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bManualCubeEditVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bStageRestartVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSolveExplanationBlocked = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bCorrectionComplete = false;

	bool IsStructurallyValid() const
	{
		if (CorrectionProfileId.IsEmpty()
			|| MissingFaceCount < 0
			|| ContradictionCount < 0
			|| ContradictionCount != Contradictions.Num()
			|| ResolvedCorrectionCount < 0
			|| ResolvedCorrectionCount != ResolutionLedger.Num())
		{
			return false;
		}

		if (bCorrectionRequired)
		{
			if (ActiveTargetFaceId.IsEmpty()
				|| !ActiveTarget.IsStructurallyValid()
				|| ActiveTargetFaceId != ActiveTarget.FaceId)
			{
				return false;
			}
		}

		for (const FHyperTwistVisionCorrectionTarget& Target : PendingTargets)
		{
			if (!Target.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistVisionCorrectionContradiction& Contradiction : Contradictions)
		{
			if (!Contradiction.IsStructurallyValid())
			{
				return false;
			}
		}

		if (!LastResolution.ResolutionId.IsEmpty() && !LastResolution.IsStructurallyValid())
		{
			return false;
		}

		for (const FHyperTwistVisionCorrectionResolution& Resolution : ResolutionLedger)
		{
			if (!Resolution.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionSessionConfig
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PuzzleId = TEXT("cube/3x3x3");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	EHyperTwistVisionCaptureMode CaptureMode = EHyperTwistVisionCaptureMode::LiveCamera;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	EHyperTwistPuzzleFamily ExpectedPuzzleFamily = EHyperTwistPuzzleFamily::ClassicCube;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString NotationProfile = TEXT("classic-wca");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CameraProfile;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CalibrationProfile;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionCalibrationProfile CalibrationProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ShellProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionShellProfile ShellProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString BrowserShellProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionBrowserShellProfile BrowserShellProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SolveExplanationProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionSolveExplanationProfile SolveExplanationProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CorrectionProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionCorrectionProfile CorrectionProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FIntPoint FrameSize = FIntPoint(1280, 720);

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 MaxFrameRate = 30;
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionFrameEnvelope
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FrameId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CapturedAtUtc;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 FrameOrdinal = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ImageRef;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CameraPoseHint;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExposureHint;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 SourceTimestampMs = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TargetFaceHint;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ObservationProfile = TEXT("classic-3x3-face-observation-v1");
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionPreviewResult
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FrameId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float PreviewConfidence = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistStateSnapshot PreviewState;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionFaceObservation ObservedFace;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionShellState ShellState;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionBrowserShellState BrowserShellState;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Guidance;
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionCommitRequest
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CommitKind = TEXT("face");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TargetFace;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TargetStage;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RequestedActionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ResolutionKind;
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionCommitResult
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CommitKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistStateSnapshot Snapshot;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float Confidence = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CommittedUnit;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionFaceObservation ObservedFace;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionReconstructionSession ReconstructionSession;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionShellState ShellState;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionBrowserShellState BrowserShellState;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionSolveExplanationState SolveExplanationState;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionCorrectionState CorrectionState;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionCorrectionResolution AppliedCorrectionResolution;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> Warnings;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> MissingUnits;
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionFinalizeResult
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistPuzzleState FinalState;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistStateSnapshot FinalSnapshot;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVisionReconstructionSession ReconstructionSession;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> ReplaySeedEventsJson;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float ConfidenceRollup = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> NormalizationWarnings;
};

USTRUCT(BlueprintType)
struct FHyperTwistVisionServiceHealth
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderLabel = TEXT("mock");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceVersion = TEXT("mock-vision/v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceEndpoint;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> Capabilities;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LastError;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bReady = true;
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechVadPolicy
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float Threshold = 0.5f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 MinSpeechDurationMs = 250;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 MinSilenceDurationMs = 200;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 MaxSpeechDurationMs = 12000;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 SpeechPadMs = 100;

	bool IsStructurallyValid() const
	{
		return Threshold > 0.0f
			&& MinSpeechDurationMs >= 0
			&& MinSilenceDurationMs >= 0
			&& MaxSpeechDurationMs >= MinSpeechDurationMs
			&& SpeechPadMs >= 0;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechTranscriptionOrchestrationProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OrchestrationProfileId = TEXT("python-batch-transcribe-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 PreferredBatchSize = 8;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ChunkLengthSeconds = 30;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 BatchCollectionWindowMs = 150;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEnableBatchedInference = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bConditionOnPreviousText = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEnableWordTimestamps = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEnableLanguageDetection = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float LanguageDetectionThreshold = 0.5f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 LanguageDetectionSegmentCount = 1;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PromptRoutingModeId = TEXT("prefix-hotword-session-hints-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PrefixHint;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> HotwordHints;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RetrievalContextLaneId = TEXT("speech-command-hint-session-memory");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 MaxRetrievedHintCount = 4;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEnableRetrievedHintAugmentation = true;

	bool IsStructurallyValid() const
	{
		return !OrchestrationProfileId.IsEmpty()
			&& !ServiceLaneId.IsEmpty()
			&& PreferredBatchSize > 0
			&& ChunkLengthSeconds > 0
			&& BatchCollectionWindowMs > 0
			&& LanguageDetectionThreshold >= 0.0f
			&& LanguageDetectionThreshold <= 1.0f
			&& LanguageDetectionSegmentCount > 0
			&& !PromptRoutingModeId.IsEmpty()
			&& !RetrievalContextLaneId.IsEmpty()
			&& MaxRetrievedHintCount > 0;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechShellPanelLayout
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PanelId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PanelKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AnchorId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bVisibleByDefault = true;

	bool IsStructurallyValid() const
	{
		return !PanelId.IsEmpty()
			&& !PanelKind.IsEmpty()
			&& !AnchorId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechShellActionBinding
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString InputBinding;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SurfaceId;

	bool IsStructurallyValid() const
	{
		return !ActionId.IsEmpty()
			&& !InputBinding.IsEmpty()
			&& !SurfaceId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechMicrophoneShellProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString MicrophoneShellProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ShellKind = TEXT("microphone-overlay");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CaptureMode = TEXT("vad-gated-short-command");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 StepWindowMs = 3000;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 CaptureWindowMs = 10000;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 KeepWindowMs = 200;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 AudioContextTokens = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float VadThreshold = 0.6f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float HighPassFrequencyHz = 100.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bKeepContextBetweenChunks = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsStreamingPreview = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsManualCommit = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PermissionContractId = TEXT("device-permission-shell-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CaptureRouteContractId = TEXT("capture-route-readiness-shell-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PermissionRequestActionId = TEXT("request-microphone-permission");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CaptureRouteRetryActionId = TEXT("retry-capture-route");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsPermissionRequest = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsCaptureRouteRetry = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellPanelLayout> Panels;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellActionBinding> ActionBindings;

	bool IsStructurallyValid() const
	{
		if (MicrophoneShellProfileId.IsEmpty()
			|| ShellKind.IsEmpty()
			|| CaptureMode.IsEmpty()
			|| StepWindowMs <= 0
			|| CaptureWindowMs < StepWindowMs
			|| KeepWindowMs < 0
			|| KeepWindowMs > CaptureWindowMs
			|| AudioContextTokens < 0
			|| VadThreshold <= 0.0f
			|| HighPassFrequencyHz < 0.0f
			|| PermissionContractId.IsEmpty()
			|| CaptureRouteContractId.IsEmpty()
			|| PermissionRequestActionId.IsEmpty()
			|| CaptureRouteRetryActionId.IsEmpty()
			|| Panels.Num() <= 0
			|| ActionBindings.Num() <= 0)
		{
			return false;
		}

		for (const FHyperTwistSpeechShellPanelLayout& Panel : Panels)
		{
			if (!Panel.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechShellActionBinding& ActionBinding : ActionBindings)
		{
			if (!ActionBinding.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechMicrophoneShellIssue
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendedActionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bBlocksCaptureStart = true;

	bool IsStructurallyValid() const
	{
		return !IssueId.IsEmpty()
			&& !IssueKind.IsEmpty()
			&& !StatusLine.IsEmpty()
			&& !DetailLine.IsEmpty()
			&& !RecommendedActionId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechMicrophoneShellState
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString MicrophoneShellProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CaptureMode = TEXT("vad-gated-short-command");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ListeningContractId = TEXT("listening-threshold-lifecycle");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString InputRouteId = TEXT("queue/listening");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PermissionStateId = TEXT("permission-granted");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CaptureRouteStateId = TEXT("route-ready");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveUtteranceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LastCommittedUtteranceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LastTranscriptPreview;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LastLanguageCode = TEXT("en");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine = TEXT("Microphone route ready for coach commands.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine = TEXT("Speak a short coach command when the shell is armed.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LastRouteError;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 StepWindowMs = 3000;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 CaptureWindowMs = 10000;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 KeepWindowMs = 200;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 SubmittedUtteranceCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 FinalTranscriptCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 DetectedSpeechStartMs = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 DetectedSpeechEndMs = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 LastSilenceGapMs = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float VadThreshold = 0.6f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSessionOpen = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bMicrophonePermissionGranted = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bCaptureRouteReady = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bCaptureActive = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bVadArmed = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAwaitingSpeech = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bTranscriptionInFlight = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bCommitReady = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bStatusPanelVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bVadMeterVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bTranscriptPreviewVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bCommandHintsVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPermissionPromptVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPermissionRequestVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bCaptureRouteRetryVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ActiveIssueCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechMicrophoneShellIssue ActiveIssue;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechMicrophoneShellIssue> Issues;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> AvailableActionIds;

	bool IsStructurallyValid() const
	{
		if (MicrophoneShellProfileId.IsEmpty()
			|| CaptureMode.IsEmpty()
			|| ListeningContractId.IsEmpty()
			|| InputRouteId.IsEmpty()
			|| PermissionStateId.IsEmpty()
			|| CaptureRouteStateId.IsEmpty()
			|| LastLanguageCode.IsEmpty()
			|| StatusLine.IsEmpty()
			|| DetailLine.IsEmpty()
			|| StepWindowMs <= 0
			|| CaptureWindowMs < StepWindowMs
			|| KeepWindowMs < 0
			|| KeepWindowMs > CaptureWindowMs
			|| SubmittedUtteranceCount < 0
			|| FinalTranscriptCount < 0
			|| DetectedSpeechStartMs < 0
			|| DetectedSpeechEndMs < DetectedSpeechStartMs
			|| LastSilenceGapMs < 0
			|| VadThreshold <= 0.0f
			|| ActiveIssueCount < 0
			|| AvailableActionIds.Num() <= 0)
		{
			return false;
		}

		if (ActiveIssueCount != Issues.Num())
		{
			return false;
		}

		if (ActiveIssueCount > 0 && !ActiveIssue.IsStructurallyValid())
		{
			return false;
		}

		for (const FHyperTwistSpeechMicrophoneShellIssue& Issue : Issues)
		{
			if (!Issue.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FString& ActionId : AvailableActionIds)
		{
			if (ActionId.IsEmpty())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechDevicePermissionWorkflowProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DevicePermissionWorkflowProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString WorkflowKind = TEXT("operator-device-permission-workflow");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PermissionContractId = TEXT("device-permission-workflow-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SettingsHandoffContractId = TEXT("device-permission-settings-handoff-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PermissionRecheckContractId = TEXT("device-permission-recheck-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PermissionRequestActionId = TEXT("request-microphone-permission");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OpenSettingsActionId = TEXT("open-microphone-privacy-settings");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PermissionRecheckActionId = TEXT("recheck-microphone-permission");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsPermissionRequest = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsSettingsHandoff = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsPermissionRecheck = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellPanelLayout> Panels;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellActionBinding> ActionBindings;

	bool IsStructurallyValid() const
	{
		if (DevicePermissionWorkflowProfileId.IsEmpty()
			|| WorkflowKind.IsEmpty()
			|| PermissionContractId.IsEmpty()
			|| SettingsHandoffContractId.IsEmpty()
			|| PermissionRecheckContractId.IsEmpty()
			|| PermissionRequestActionId.IsEmpty()
			|| OpenSettingsActionId.IsEmpty()
			|| PermissionRecheckActionId.IsEmpty()
			|| Panels.Num() <= 0
			|| ActionBindings.Num() <= 0)
		{
			return false;
		}

		for (const FHyperTwistSpeechShellPanelLayout& Panel : Panels)
		{
			if (!Panel.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechShellActionBinding& ActionBinding : ActionBindings)
		{
			if (!ActionBinding.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechDevicePermissionWorkflowEntry
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString EntryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SourceKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString WorkflowStateId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendedActionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresSettingsHandoff = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresPermissionRecheck = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPermissionGranted = true;

	bool IsStructurallyValid() const
	{
		return !EntryId.IsEmpty()
			&& !SourceKind.IsEmpty()
			&& !WorkflowStateId.IsEmpty()
			&& !StatusLine.IsEmpty()
			&& !DetailLine.IsEmpty()
			&& !RecommendedActionId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechDevicePermissionWorkflowIssue
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendedActionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bBlocksCaptureStart = true;

	bool IsStructurallyValid() const
	{
		return !IssueId.IsEmpty()
			&& !IssueKind.IsEmpty()
			&& !StatusLine.IsEmpty()
			&& !DetailLine.IsEmpty()
			&& !RecommendedActionId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechDevicePermissionWorkflowState
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DevicePermissionWorkflowProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString WorkflowStateId = TEXT("permission-workflow-cleared");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PermissionStateId = TEXT("permission-granted");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestSourceKind = TEXT("permission-state-granted");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine = TEXT("Microphone permission already granted.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine =
		TEXT("The first-party permission workflow is clear for the bounded speech shell.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LastPermissionError;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 WorkflowEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 PermissionRequestEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 SettingsHandoffEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 PermissionRecheckEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPermissionGranted = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bWorkflowSummaryReady = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPermissionWorkflowReady = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSettingsReviewRecommended = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPermissionRequestVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSettingsHandoffVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPermissionRecheckVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ActiveIssueCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechDevicePermissionWorkflowIssue ActiveIssue;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechDevicePermissionWorkflowEntry> Entries;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechDevicePermissionWorkflowIssue> Issues;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> AvailableActionIds;

	bool IsStructurallyValid() const
	{
		if (DevicePermissionWorkflowProfileId.IsEmpty()
			|| WorkflowStateId.IsEmpty()
			|| PermissionStateId.IsEmpty()
			|| LatestSourceKind.IsEmpty()
			|| StatusLine.IsEmpty()
			|| DetailLine.IsEmpty()
			|| WorkflowEntryCount < 0
			|| PermissionRequestEntryCount < 0
			|| SettingsHandoffEntryCount < 0
			|| PermissionRecheckEntryCount < 0
			|| ActiveIssueCount < 0
			|| AvailableActionIds.Num() <= 0)
		{
			return false;
		}

		if (WorkflowEntryCount != Entries.Num()
			|| ActiveIssueCount != Issues.Num()
			|| PermissionRequestEntryCount > WorkflowEntryCount
			|| SettingsHandoffEntryCount > WorkflowEntryCount
			|| PermissionRecheckEntryCount > WorkflowEntryCount)
		{
			return false;
		}

		if (ActiveIssueCount > 0 && !ActiveIssue.IsStructurallyValid())
		{
			return false;
		}

		for (const FHyperTwistSpeechDevicePermissionWorkflowEntry& Entry : Entries)
		{
			if (!Entry.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechDevicePermissionWorkflowIssue& Issue : Issues)
		{
			if (!Issue.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FString& ActionId : AvailableActionIds)
		{
			if (ActionId.IsEmpty())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechNativeCaptureRouteWorkflowProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString NativeCaptureRouteWorkflowProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString WorkflowKind = TEXT("first-party-native-capture-route-workflow");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OwnershipContractId = TEXT("native-capture-route-ownership-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PreparationContractId = TEXT("native-capture-route-preparation-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionReopenContractId = TEXT("native-capture-route-session-reopen-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RouteInspectActionId = TEXT("inspect-native-capture-route");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PreparationRetryActionId = TEXT("retry-capture-route");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionReopenActionId = TEXT("reopen-speech-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PermissionDependencyActionId = TEXT("resolve-device-permission-workflow");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsRouteInspect = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsPreparationRetry = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsSessionReopen = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellPanelLayout> Panels;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellActionBinding> ActionBindings;

	bool IsStructurallyValid() const
	{
		if (NativeCaptureRouteWorkflowProfileId.IsEmpty()
			|| WorkflowKind.IsEmpty()
			|| OwnershipContractId.IsEmpty()
			|| PreparationContractId.IsEmpty()
			|| SessionReopenContractId.IsEmpty()
			|| RouteInspectActionId.IsEmpty()
			|| PreparationRetryActionId.IsEmpty()
			|| SessionReopenActionId.IsEmpty()
			|| PermissionDependencyActionId.IsEmpty()
			|| Panels.Num() <= 0
			|| ActionBindings.Num() <= 0)
		{
			return false;
		}

		for (const FHyperTwistSpeechShellPanelLayout& Panel : Panels)
		{
			if (!Panel.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechShellActionBinding& ActionBinding : ActionBindings)
		{
			if (!ActionBinding.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechNativeCaptureRouteWorkflowEntry
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString EntryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SourceKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString WorkflowStateId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CaptureRouteStateId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendedActionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresSessionOpen = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresPermissionWorkflow = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresPreparation = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresRouteRetry = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bOwnershipConfirmed = false;

	bool IsStructurallyValid() const
	{
		return !EntryId.IsEmpty()
			&& !SourceKind.IsEmpty()
			&& !WorkflowStateId.IsEmpty()
			&& !CaptureRouteStateId.IsEmpty()
			&& !StatusLine.IsEmpty()
			&& !DetailLine.IsEmpty()
			&& !RecommendedActionId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechNativeCaptureRouteWorkflowIssue
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendedActionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bBlocksCaptureStart = true;

	bool IsStructurallyValid() const
	{
		return !IssueId.IsEmpty()
			&& !IssueKind.IsEmpty()
			&& !StatusLine.IsEmpty()
			&& !DetailLine.IsEmpty()
			&& !RecommendedActionId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechNativeCaptureRouteWorkflowState
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString NativeCaptureRouteWorkflowProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString WorkflowStateId = TEXT("capture-route-workflow-cleared");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CaptureRouteStateId = TEXT("route-ready");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PermissionStateId = TEXT("permission-granted");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestSourceKind = TEXT("capture-route-ready");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine = TEXT("Native capture route already owned for the bounded speech session.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine =
		TEXT("The first-party native capture-route workflow is clear for the active speech lane.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LastRouteError;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 WorkflowEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 PreparationEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RouteRetryEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 SessionReopenEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 PermissionDependencyEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRouteOwnershipConfirmed = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bWorkflowReady = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreparationRequired = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSessionOpenRequired = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPermissionWorkflowBlocked = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRouteInspectVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreparationRetryVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSessionReopenVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ActiveIssueCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechNativeCaptureRouteWorkflowIssue ActiveIssue;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechNativeCaptureRouteWorkflowEntry> Entries;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechNativeCaptureRouteWorkflowIssue> Issues;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> AvailableActionIds;

	bool IsStructurallyValid() const
	{
		if (NativeCaptureRouteWorkflowProfileId.IsEmpty()
			|| WorkflowStateId.IsEmpty()
			|| CaptureRouteStateId.IsEmpty()
			|| PermissionStateId.IsEmpty()
			|| ActiveProviderProfileId.IsEmpty()
			|| ActiveServiceLaneId.IsEmpty()
			|| LatestSourceKind.IsEmpty()
			|| StatusLine.IsEmpty()
			|| DetailLine.IsEmpty()
			|| WorkflowEntryCount < 0
			|| PreparationEntryCount < 0
			|| RouteRetryEntryCount < 0
			|| SessionReopenEntryCount < 0
			|| PermissionDependencyEntryCount < 0
			|| ActiveIssueCount < 0
			|| AvailableActionIds.Num() <= 0)
		{
			return false;
		}

		if (WorkflowEntryCount != Entries.Num()
			|| ActiveIssueCount != Issues.Num()
			|| PreparationEntryCount > WorkflowEntryCount
			|| RouteRetryEntryCount > WorkflowEntryCount
			|| SessionReopenEntryCount > WorkflowEntryCount
			|| PermissionDependencyEntryCount > WorkflowEntryCount)
		{
			return false;
		}

		if (ActiveIssueCount > 0 && !ActiveIssue.IsStructurallyValid())
		{
			return false;
		}

		for (const FHyperTwistSpeechNativeCaptureRouteWorkflowEntry& Entry : Entries)
		{
			if (!Entry.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechNativeCaptureRouteWorkflowIssue& Issue : Issues)
		{
			if (!Issue.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FString& ActionId : AvailableActionIds)
		{
			if (ActionId.IsEmpty())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechModelPayloadDescriptor
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PayloadId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PayloadKind = TEXT("whisper-ggml-model");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ModelFamily = TEXT("whisper");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VariantId = TEXT("base.en");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ArtifactName = TEXT("ggml-base.en.bin");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RelativePathHint = TEXT("models/ggml-base.en.bin");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SourceDocumentPath = TEXT("whisper.cpp/models/README.md");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AcquisitionMode = TEXT("manual-download-or-convert");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IntegrityCheckKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IntegrityCheckValue;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ApproximateSizeMiB = 142;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bOptionalForSession = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUserSuppliedOnly = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bBundledWithCodeDistribution = false;

	bool IsStructurallyValid() const
	{
		return !PayloadId.IsEmpty()
			&& !PayloadKind.IsEmpty()
			&& !ModelFamily.IsEmpty()
			&& !VariantId.IsEmpty()
			&& !ArtifactName.IsEmpty()
			&& !RelativePathHint.IsEmpty()
			&& !SourceDocumentPath.IsEmpty()
			&& !AcquisitionMode.IsEmpty()
			&& ApproximateSizeMiB > 0
			&& (IntegrityCheckKind.IsEmpty() == IntegrityCheckValue.IsEmpty());
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechPayloadCustodyProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PayloadCustodyProfileId = TEXT("downloadable-model-payload-custody-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PayloadReviewPosture = TEXT("independent-payload-review-required");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ShippingPosture = TEXT("not-shipped-in-packet");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DownloadWorkflowPosture = TEXT("deferred-out-of-packet");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProvisioningPosture = TEXT("user-supplied-or-sidecar-managed");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CodeLicenseBoundary = TEXT("code-license-reviewed-separately");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresIndependentPayloadReview = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowsBundledPayloadRedistribution = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowsRuntimeDownloadInCurrentPacket = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsUserManagedPayloads = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsSidecarManagedPayloads = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresIntegrityVerification = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreservesProviderNeutrality = true;

	bool IsStructurallyValid() const
	{
		return !PayloadCustodyProfileId.IsEmpty()
			&& !PayloadReviewPosture.IsEmpty()
			&& !ShippingPosture.IsEmpty()
			&& !DownloadWorkflowPosture.IsEmpty()
			&& !ProvisioningPosture.IsEmpty()
			&& !CodeLicenseBoundary.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechProviderProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DisplayLabel = TEXT("Local Speech Sidecar");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderClass = TEXT("bounded-speech-sidecar-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString EndpointClass = TEXT("local-self-hosted-http");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString EndpointReferenceId = TEXT("speech/provider-profile/local-http-sidecar");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString EndpointBaseUrl = TEXT("http://127.0.0.1:8766");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AuthMaterialSource = TEXT("first-party-out-of-band-secret-reference");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AuthReferenceId = TEXT("speech/byok/local-http-sidecar/default");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ModelSelectionMode = TEXT("per-profile-model-map");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> SupportedModelIds;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> CapabilityFlags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEnabled = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUserLabeled = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsEnableDisable = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsCustomBaseUrl = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreservesFirstPartyCustody = true;

	bool IsStructurallyValid() const
	{
		if (ProviderProfileId.IsEmpty()
			|| DisplayLabel.IsEmpty()
			|| ProviderClass.IsEmpty()
			|| EndpointClass.IsEmpty()
			|| EndpointReferenceId.IsEmpty()
			|| AuthMaterialSource.IsEmpty()
			|| ModelSelectionMode.IsEmpty()
			|| SupportedModelIds.Num() <= 0
			|| CapabilityFlags.Num() <= 0)
		{
			return false;
		}

		if (!AuthMaterialSource.Equals(TEXT("not-required"), ESearchCase::CaseSensitive)
			&& AuthReferenceId.IsEmpty())
		{
			return false;
		}

		for (const FString& ModelId : SupportedModelIds)
		{
			if (ModelId.IsEmpty())
			{
				return false;
			}
		}

		for (const FString& CapabilityFlag : CapabilityFlags)
		{
			if (CapabilityFlag.IsEmpty())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechByokCustodyProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ByokCustodyProfileId = TEXT("speech-byok-custody-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString KeyCustodyPosture = TEXT("first-party-user-supplied");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString EndpointCustodyPosture = TEXT("first-party-custom-endpoint-owned");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SecretStoragePosture = TEXT("out-of-band-secret-reference-only");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProfileLabelingPosture = TEXT("user-labeled-byok-profile-supported");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString EnablementPosture = TEXT("per-profile-enable-disable-supported");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> SupportedProviderClasses;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsOfficialProviderProfiles = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsOpenAiCompatibleCustomEndpoints = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsManagedGatewayProfiles = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsLocalSelfHostedProfiles = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsBoundedSidecarProfiles = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsUserLabeledProfiles = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsPerProfileModelMaps = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsPerProfileAuthMaterial = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsEnableDisableControls = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bStoresSecretsOutOfBand = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreservesProviderNeutrality = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowsDonorOwnedKeyCustody = false;

	bool IsStructurallyValid() const
	{
		if (ByokCustodyProfileId.IsEmpty()
			|| KeyCustodyPosture.IsEmpty()
			|| EndpointCustodyPosture.IsEmpty()
			|| SecretStoragePosture.IsEmpty()
			|| ProfileLabelingPosture.IsEmpty()
			|| EnablementPosture.IsEmpty()
			|| SupportedProviderClasses.Num() <= 0)
		{
			return false;
		}

		for (const FString& ProviderClassId : SupportedProviderClasses)
		{
			if (ProviderClassId.IsEmpty())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechProviderRoutingPolicy
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderRoutingPolicyId = TEXT("speech-provider-routing/provider-backed-sidecar-first-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PolicyKind = TEXT("speech-provider-routing");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RouteSelectionMode = TEXT("provider-backed-sidecar-first");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FallbackMode = TEXT("health-posture-only");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString WorkflowPolicyState = TEXT("first-party-provider-policy-governed");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FailureEscalationMode = TEXT("fail-closed-and-report-health");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UserOverridePosture = TEXT("profile-or-client-kind-override-supported");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> EligibleProviderClasses;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> EligibleEndpointClasses;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> RequiredCapabilityFlags;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> SupportedTaskKinds;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowProviderBackedRoutes = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowMockVerificationRoutes = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowOpenAiCompatibleCustomEndpointRoutes = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowUserLabeledByokRoutes = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowManagedGatewayRoutes = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowLocalSelfHostedRoutes = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRespectsProfileEnableDisable = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowFailClosedWhenNoEligibleRoute = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowHealthPostureFallback = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreservesFirstPartyRoutingOwnership = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowsDonorOwnedRoutingLanguage = false;

	bool IsStructurallyValid() const
	{
		if (ProviderRoutingPolicyId.IsEmpty()
			|| PolicyKind.IsEmpty()
			|| RouteSelectionMode.IsEmpty()
			|| FallbackMode.IsEmpty()
			|| WorkflowPolicyState.IsEmpty()
			|| FailureEscalationMode.IsEmpty()
			|| UserOverridePosture.IsEmpty()
			|| EligibleProviderClasses.Num() <= 0
			|| EligibleEndpointClasses.Num() <= 0
			|| RequiredCapabilityFlags.Num() <= 0
			|| SupportedTaskKinds.Num() <= 0)
		{
			return false;
		}

		for (const FString& ProviderClassId : EligibleProviderClasses)
		{
			if (ProviderClassId.IsEmpty())
			{
				return false;
			}
		}

		for (const FString& EndpointClassId : EligibleEndpointClasses)
		{
			if (EndpointClassId.IsEmpty())
			{
				return false;
			}
		}

		for (const FString& CapabilityFlag : RequiredCapabilityFlags)
		{
			if (CapabilityFlag.IsEmpty())
			{
				return false;
			}
		}

		for (const FString& TaskKindId : SupportedTaskKinds)
		{
			if (TaskKindId.IsEmpty())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechProviderRouteDecision
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RouteDecisionId = TEXT("speech-route-decision/provider-backed-sidecar");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderRoutingPolicyId = TEXT("speech-provider-routing/provider-backed-sidecar-first-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DecisionSource = TEXT("session-config-default");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RequestedProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SelectedProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SelectedProviderClass = TEXT("bounded-speech-sidecar-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SelectedEndpointClass = TEXT("local-self-hosted-http");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SelectedServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SelectedTransportKind = TEXT("http");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RouteStateId = TEXT("route-ready");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DecisionReason = TEXT("provider-backed-sidecar-route-selected");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FailureReason;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString FallbackMode = TEXT("health-posture-only");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bProviderBackedRouteRequested = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bProviderBackedRouteSelected = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUsedFallbackHealthPosture = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSelectedProfileEnabled = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSelectedCustomEndpointRoute = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRouteReady = true;

	bool IsStructurallyValid() const
	{
		return !RouteDecisionId.IsEmpty()
			&& !ProviderRoutingPolicyId.IsEmpty()
			&& !DecisionSource.IsEmpty()
			&& !RequestedProviderProfileId.IsEmpty()
			&& !SelectedProviderProfileId.IsEmpty()
			&& !SelectedProviderClass.IsEmpty()
			&& !SelectedEndpointClass.IsEmpty()
			&& !SelectedServiceLaneId.IsEmpty()
			&& !SelectedTransportKind.IsEmpty()
			&& !RouteStateId.IsEmpty()
			&& !DecisionReason.IsEmpty()
			&& !FallbackMode.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechUsageCostAccountingProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UsageCostAccountingProfileId = TEXT("speech-usage-cost-accounting-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AccountingKind = TEXT("normalized-usage-cost-events");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UsageAggregationMode = TEXT("session-and-health-summary");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CostAggregationMode = TEXT("estimate-first-with-provider-receipt-optional");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString QuotaVisibilityMode = TEXT("first-party-health-surface");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString EscalationMode = TEXT("surface-budget-and-quota-state");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UserOverridePosture = TEXT("profile-or-session-override-supported");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> NormalizedMeterKinds;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> NormalizedCurrencyCodes;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsProviderReceiptNormalization = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsEstimateOnlyMode = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsQuotaSnapshots = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsRateLimitSnapshots = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreservesFirstPartyAccountingOwnership = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowsDonorOwnedCostGovernance = false;

	bool IsStructurallyValid() const
	{
		if (UsageCostAccountingProfileId.IsEmpty()
			|| AccountingKind.IsEmpty()
			|| UsageAggregationMode.IsEmpty()
			|| CostAggregationMode.IsEmpty()
			|| QuotaVisibilityMode.IsEmpty()
			|| EscalationMode.IsEmpty()
			|| UserOverridePosture.IsEmpty()
			|| NormalizedMeterKinds.Num() <= 0
			|| NormalizedCurrencyCodes.Num() <= 0)
		{
			return false;
		}

		for (const FString& MeterKind : NormalizedMeterKinds)
		{
			if (MeterKind.IsEmpty())
			{
				return false;
			}
		}

		for (const FString& CurrencyCode : NormalizedCurrencyCodes)
		{
			if (CurrencyCode.IsEmpty())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechNormalizedUsageEvent
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UsageEventId = TEXT("speech-usage-event/current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UsageCostAccountingProfileId = TEXT("speech-usage-cost-accounting-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString EventKind = TEXT("bounded-session-usage-summary");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString MeterKind = TEXT("audio-seconds");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UsageUnitKind = TEXT("audio-seconds");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AggregationWindowId = TEXT("current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CapturedAtUtc = TEXT("2026-05-25T00:00:00Z");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RawEventReferenceId = TEXT("speech-session-default");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float ReportedQuantity = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float BilledQuantity = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bDerivedFromProviderReceipt = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEstimateOnly = true;

	bool IsStructurallyValid() const
	{
		return !UsageEventId.IsEmpty()
			&& !UsageCostAccountingProfileId.IsEmpty()
			&& !ProviderProfileId.IsEmpty()
			&& !ServiceLaneId.IsEmpty()
			&& !EventKind.IsEmpty()
			&& !MeterKind.IsEmpty()
			&& !UsageUnitKind.IsEmpty()
			&& !AggregationWindowId.IsEmpty()
			&& !CapturedAtUtc.IsEmpty()
			&& !RawEventReferenceId.IsEmpty()
			&& ReportedQuantity >= 0.0f
			&& BilledQuantity >= 0.0f;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechNormalizedCostEvent
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CostEventId = TEXT("speech-cost-event/current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UsageCostAccountingProfileId = TEXT("speech-usage-cost-accounting-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString EventKind = TEXT("bounded-session-cost-summary");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CurrencyCode = TEXT("USD");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PricingSourceId = TEXT("first-party-estimate");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AggregationWindowId = TEXT("current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CapturedAtUtc = TEXT("2026-05-25T00:00:00Z");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float EstimatedCost = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float ReportedCost = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEstimateOnly = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bHasProviderPostedCharge = false;

	bool IsStructurallyValid() const
	{
		return !CostEventId.IsEmpty()
			&& !UsageCostAccountingProfileId.IsEmpty()
			&& !ProviderProfileId.IsEmpty()
			&& !ServiceLaneId.IsEmpty()
			&& !EventKind.IsEmpty()
			&& !CurrencyCode.IsEmpty()
			&& !PricingSourceId.IsEmpty()
			&& !AggregationWindowId.IsEmpty()
			&& !CapturedAtUtc.IsEmpty()
			&& EstimatedCost >= 0.0f
			&& ReportedCost >= 0.0f;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechQuotaRateLimitState
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString QuotaStateId = TEXT("speech-quota-state/current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UsageCostAccountingProfileId = TEXT("speech-usage-cost-accounting-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RateLimitWindowId = TEXT("per-minute");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ResetAtUtc = TEXT("2026-05-25T00:01:00Z");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StateReason = TEXT("within-budget");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RemainingRequestCount = 60;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RemainingAudioSeconds = 3600;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float RemainingEstimatedSpendUsd = 25.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bQuotaKnown = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRateLimited = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bHardBlocked = false;

	bool IsStructurallyValid() const
	{
		return !QuotaStateId.IsEmpty()
			&& !UsageCostAccountingProfileId.IsEmpty()
			&& !ProviderProfileId.IsEmpty()
			&& !ServiceLaneId.IsEmpty()
			&& !RateLimitWindowId.IsEmpty()
			&& !ResetAtUtc.IsEmpty()
			&& !StateReason.IsEmpty()
			&& RemainingRequestCount >= 0
			&& RemainingAudioSeconds >= 0
			&& RemainingEstimatedSpendUsd >= 0.0f;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechNativeCaptureRouteShellProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString NativeCaptureRouteShellProfileId = TEXT("speech-native-capture-route-shell-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ShellKind = TEXT("operator-native-capture-route-workflow");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OwnershipSummarySurfaceMode = TEXT("capture-route-ownership-summary-card");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PreparationSurfaceMode = TEXT("capture-route-preparation-card");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionReopenSurfaceMode = TEXT("capture-route-session-reopen-card");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RouteInspectActionId = TEXT("inspect-native-capture-route");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PreparationRetryActionId = TEXT("retry-capture-route");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionReopenActionId = TEXT("reopen-speech-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PermissionDependencyActionId = TEXT("resolve-device-permission-workflow");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsOwnershipSummaryCard = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsPreparationCard = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsSessionReopenCard = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsPermissionDependencyBanner = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellPanelLayout> Panels;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellActionBinding> ActionBindings;

	bool IsStructurallyValid() const
	{
		if (NativeCaptureRouteShellProfileId.IsEmpty()
			|| ShellKind.IsEmpty()
			|| OwnershipSummarySurfaceMode.IsEmpty()
			|| PreparationSurfaceMode.IsEmpty()
			|| SessionReopenSurfaceMode.IsEmpty()
			|| RouteInspectActionId.IsEmpty()
			|| PreparationRetryActionId.IsEmpty()
			|| SessionReopenActionId.IsEmpty()
			|| PermissionDependencyActionId.IsEmpty()
			|| Panels.Num() <= 0
			|| ActionBindings.Num() <= 0)
		{
			return false;
		}

		for (const FHyperTwistSpeechShellPanelLayout& Panel : Panels)
		{
			if (!Panel.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechShellActionBinding& ActionBinding : ActionBindings)
		{
			if (!ActionBinding.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechNativeCaptureRouteShellState
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString NativeCaptureRouteShellProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString NativeCaptureRouteWorkflowProfileId =
		TEXT("speech-native-capture-route-workflow-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString WorkflowStateId = TEXT("capture-route-workflow-cleared");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CaptureRouteStateId = TEXT("route-ready");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PermissionStateId = TEXT("permission-granted");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestSourceKind = TEXT("capture-route-ready");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine =
		TEXT("Native capture route already owned for the bounded speech session.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine =
		TEXT("The first-party native capture-route workflow is clear for the active speech lane.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LastRouteError;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bShellVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bOwnershipSummaryVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreparationCardVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSessionReopenCardVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPermissionDependencyBannerVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRouteOwnershipConfirmed = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bWorkflowReady = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreparationRequired = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSessionOpenRequired = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPermissionWorkflowBlocked = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRouteInspectVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreparationRetryVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSessionReopenVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ActiveIssueCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechNativeCaptureRouteWorkflowIssue ActiveIssue;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechNativeCaptureRouteWorkflowEntry> Entries;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechNativeCaptureRouteWorkflowIssue> Issues;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> AvailableActionIds;

	bool IsStructurallyValid() const
	{
		if (NativeCaptureRouteShellProfileId.IsEmpty()
			|| NativeCaptureRouteWorkflowProfileId.IsEmpty()
			|| ActiveProviderProfileId.IsEmpty()
			|| ActiveServiceLaneId.IsEmpty()
			|| WorkflowStateId.IsEmpty()
			|| CaptureRouteStateId.IsEmpty()
			|| PermissionStateId.IsEmpty()
			|| LatestSourceKind.IsEmpty()
			|| StatusLine.IsEmpty()
			|| DetailLine.IsEmpty()
			|| ActiveIssueCount < 0
			|| AvailableActionIds.Num() <= 0)
		{
			return false;
		}

		if (ActiveIssueCount != Issues.Num())
		{
			return false;
		}

		if (ActiveIssueCount > 0 && !ActiveIssue.IsStructurallyValid())
		{
			return false;
		}

		for (const FHyperTwistSpeechNativeCaptureRouteWorkflowEntry& Entry : Entries)
		{
			if (!Entry.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechNativeCaptureRouteWorkflowIssue& Issue : Issues)
		{
			if (!Issue.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FString& ActionId : AvailableActionIds)
		{
			if (ActionId.IsEmpty())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechUsageCostDashboardShellProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DashboardShellProfileId = TEXT("speech-provider-usage-cost-dashboard-shell-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ShellKind = TEXT("operator-usage-cost-dashboard");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UsageSurfaceMode = TEXT("normalized-usage-summary-card");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CostSurfaceMode = TEXT("estimate-first-cost-card");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString EscalationBannerMode = TEXT("route-and-budget-posture-banner");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RefreshActionId = TEXT("refresh-provider-usage-cost-dashboard");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RouteInspectActionId = TEXT("inspect-provider-route");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString BudgetInspectActionId = TEXT("review-provider-budget");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsProviderSummary = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsEstimateBadges = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsQuotaEscalationBanner = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsRouteDiagnostics = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellPanelLayout> Panels;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellActionBinding> ActionBindings;

	bool IsStructurallyValid() const
	{
		if (DashboardShellProfileId.IsEmpty()
			|| ShellKind.IsEmpty()
			|| UsageSurfaceMode.IsEmpty()
			|| CostSurfaceMode.IsEmpty()
			|| EscalationBannerMode.IsEmpty()
			|| RefreshActionId.IsEmpty()
			|| RouteInspectActionId.IsEmpty()
			|| BudgetInspectActionId.IsEmpty()
			|| Panels.Num() <= 0
			|| ActionBindings.Num() <= 0)
		{
			return false;
		}

		for (const FHyperTwistSpeechShellPanelLayout& Panel : Panels)
		{
			if (!Panel.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechShellActionBinding& ActionBinding : ActionBindings)
		{
			if (!ActionBinding.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechUsageCostDashboardIssue
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendedActionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresOperatorAttention = true;

	bool IsStructurallyValid() const
	{
		return !IssueId.IsEmpty()
			&& !IssueKind.IsEmpty()
			&& !StatusLine.IsEmpty()
			&& !DetailLine.IsEmpty()
			&& !RecommendedActionId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechUsageCostDashboardShellState
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DashboardShellProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveProviderDisplayLabel = TEXT("Local HTTP Speech Sidecar");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveRouteStateId = TEXT("route-ready");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UsageAggregationWindowId = TEXT("service-health-window");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CostAggregationWindowId = TEXT("service-health-window");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UsageMeterKind = TEXT("audio-seconds");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CurrencyCode = TEXT("USD");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine = TEXT("Provider usage and budget posture within current bounds.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine = TEXT("Normalized usage, cost, and quota posture are ready for operator review.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestUsageEventId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestCostEventId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestQuotaStateId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestRouteDecisionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float DisplayedUsageQuantity = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float DisplayedEstimatedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float DisplayedReportedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float RemainingEstimatedSpendUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RemainingRequestCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RemainingAudioSeconds = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bDashboardVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bProviderSummaryVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUsageCardVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bCostCardVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bQuotaCardVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRouteDiagnosticsVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEstimateBadgeVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEscalationBannerVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bProviderReceiptPosted = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bQuotaKnown = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRateLimited = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bHardBlocked = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRouteReady = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ActiveIssueCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechUsageCostDashboardIssue ActiveIssue;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechUsageCostDashboardIssue> Issues;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> AvailableActionIds;

	bool IsStructurallyValid() const
	{
		if (DashboardShellProfileId.IsEmpty()
			|| ActiveProviderProfileId.IsEmpty()
			|| ActiveProviderDisplayLabel.IsEmpty()
			|| ActiveServiceLaneId.IsEmpty()
			|| ActiveRouteStateId.IsEmpty()
			|| UsageAggregationWindowId.IsEmpty()
			|| CostAggregationWindowId.IsEmpty()
			|| UsageMeterKind.IsEmpty()
			|| CurrencyCode.IsEmpty()
			|| StatusLine.IsEmpty()
			|| DetailLine.IsEmpty()
			|| LatestUsageEventId.IsEmpty()
			|| LatestCostEventId.IsEmpty()
			|| LatestQuotaStateId.IsEmpty()
			|| LatestRouteDecisionId.IsEmpty()
			|| DisplayedUsageQuantity < 0.0f
			|| DisplayedEstimatedCostUsd < 0.0f
			|| DisplayedReportedCostUsd < 0.0f
			|| RemainingEstimatedSpendUsd < 0.0f
			|| RemainingRequestCount < 0
			|| RemainingAudioSeconds < 0
			|| ActiveIssueCount < 0
			|| AvailableActionIds.Num() <= 0)
		{
			return false;
		}

		if (ActiveIssueCount != Issues.Num())
		{
			return false;
		}

		if (ActiveIssueCount > 0 && !ActiveIssue.IsStructurallyValid())
		{
			return false;
		}

		for (const FHyperTwistSpeechUsageCostDashboardIssue& Issue : Issues)
		{
			if (!Issue.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FString& ActionId : AvailableActionIds)
		{
			if (ActionId.IsEmpty())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechUsageCostHistoryExportShellProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HistoryExportShellProfileId = TEXT("speech-provider-usage-cost-history-export-shell-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ShellKind = TEXT("operator-usage-cost-history-export");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HistorySurfaceMode = TEXT("rolling-usage-cost-snapshot-history");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExportSurfaceMode = TEXT("first-party-summary-preview");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RefreshActionId = TEXT("refresh-provider-usage-cost-history");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExportPreviewActionId = TEXT("preview-provider-usage-cost-export");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CopySummaryActionId = TEXT("copy-provider-usage-cost-summary");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RouteInspectActionId = TEXT("inspect-provider-route");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString BudgetInspectActionId = TEXT("review-provider-budget");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RetainedHistoryEntryLimit = 12;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsHistoryTimeline = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsExportPreview = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsCopySummary = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsEstimateWatermark = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreservesFirstPartySummaryOwnership = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellPanelLayout> Panels;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellActionBinding> ActionBindings;

	bool IsStructurallyValid() const
	{
		if (HistoryExportShellProfileId.IsEmpty()
			|| ShellKind.IsEmpty()
			|| HistorySurfaceMode.IsEmpty()
			|| ExportSurfaceMode.IsEmpty()
			|| RefreshActionId.IsEmpty()
			|| ExportPreviewActionId.IsEmpty()
			|| CopySummaryActionId.IsEmpty()
			|| RouteInspectActionId.IsEmpty()
			|| BudgetInspectActionId.IsEmpty()
			|| RetainedHistoryEntryLimit <= 0
			|| Panels.Num() <= 0
			|| ActionBindings.Num() <= 0)
		{
			return false;
		}

		for (const FHyperTwistSpeechShellPanelLayout& Panel : Panels)
		{
			if (!Panel.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechShellActionBinding& ActionBinding : ActionBindings)
		{
			if (!ActionBinding.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechUsageCostHistoryEntry
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HistoryEntryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SourceKind = TEXT("service-health-snapshot");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionId = TEXT("speech-session-default");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UsageEventId = TEXT("speech-usage-event/current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CostEventId = TEXT("speech-cost-event/current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString QuotaStateId = TEXT("speech-quota-state/current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RouteDecisionId = TEXT("speech-route-decision/current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CapturedAtUtc = TEXT("2026-05-25T00:00:00Z");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float UsageQuantity = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float EstimatedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float ReportedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float RemainingEstimatedSpendUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RemainingRequestCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RemainingAudioSeconds = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEstimateOnly = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bProviderReceiptPosted = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bQuotaKnown = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRateLimited = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bHardBlocked = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRouteReady = true;

	bool IsStructurallyValid() const
	{
		return !HistoryEntryId.IsEmpty()
			&& !SourceKind.IsEmpty()
			&& !SessionId.IsEmpty()
			&& !ProviderProfileId.IsEmpty()
			&& !ServiceLaneId.IsEmpty()
			&& !UsageEventId.IsEmpty()
			&& !CostEventId.IsEmpty()
			&& !QuotaStateId.IsEmpty()
			&& !RouteDecisionId.IsEmpty()
			&& !CapturedAtUtc.IsEmpty()
			&& UsageQuantity >= 0.0f
			&& EstimatedCostUsd >= 0.0f
			&& ReportedCostUsd >= 0.0f
			&& RemainingEstimatedSpendUsd >= 0.0f
			&& RemainingRequestCount >= 0
			&& RemainingAudioSeconds >= 0;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechUsageCostHistoryExportIssue
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendedActionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresOperatorAttention = true;

	bool IsStructurallyValid() const
	{
		return !IssueId.IsEmpty()
			&& !IssueKind.IsEmpty()
			&& !StatusLine.IsEmpty()
			&& !DetailLine.IsEmpty()
			&& !RecommendedActionId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechUsageCostHistoryExportShellState
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HistoryExportShellProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveProviderDisplayLabel = TEXT("Local HTTP Speech Sidecar");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SelectedHistoryWindowId = TEXT("current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExportPreviewFormatId = TEXT("first-party-summary-preview");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestHistoryEntryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestSourceKind = TEXT("service-health-snapshot");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine = TEXT("Provider usage/cost history ready for operator preview.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine = TEXT("First-party usage/cost history is ready for bounded preview and copy surfaces.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExportPreviewText;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 HistoryEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 EstimateOnlyEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ProviderReceiptEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float TotalUsageQuantity = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float TotalEstimatedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float TotalReportedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float LowestRemainingEstimatedSpendUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bHistoryVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bExportPreviewVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEstimateWatermarkVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bExportPreviewReady = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bCopySummaryReady = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ActiveIssueCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechUsageCostHistoryExportIssue ActiveIssue;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechUsageCostHistoryExportIssue> Issues;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechUsageCostHistoryEntry> HistoryEntries;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> AvailableActionIds;

	FString LastRecordedSignature;

	bool IsStructurallyValid() const
	{
		if (HistoryExportShellProfileId.IsEmpty()
			|| ActiveProviderProfileId.IsEmpty()
			|| ActiveProviderDisplayLabel.IsEmpty()
			|| ActiveServiceLaneId.IsEmpty()
			|| SelectedHistoryWindowId.IsEmpty()
			|| ExportPreviewFormatId.IsEmpty()
			|| LatestSourceKind.IsEmpty()
			|| StatusLine.IsEmpty()
			|| DetailLine.IsEmpty()
			|| HistoryEntryCount < 0
			|| EstimateOnlyEntryCount < 0
			|| ProviderReceiptEntryCount < 0
			|| TotalUsageQuantity < 0.0f
			|| TotalEstimatedCostUsd < 0.0f
			|| TotalReportedCostUsd < 0.0f
			|| LowestRemainingEstimatedSpendUsd < 0.0f
			|| ActiveIssueCount < 0
			|| AvailableActionIds.Num() <= 0)
		{
			return false;
		}

		if (HistoryEntryCount != HistoryEntries.Num())
		{
			return false;
		}

		if (HistoryEntryCount > 0 && LatestHistoryEntryId.IsEmpty())
		{
			return false;
		}

		if (bExportPreviewReady && ExportPreviewText.IsEmpty())
		{
			return false;
		}

		if (ActiveIssueCount != Issues.Num())
		{
			return false;
		}

		if (ActiveIssueCount > 0 && !ActiveIssue.IsStructurallyValid())
		{
			return false;
		}

		for (const FHyperTwistSpeechUsageCostHistoryExportIssue& Issue : Issues)
		{
			if (!Issue.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechUsageCostHistoryEntry& HistoryEntry : HistoryEntries)
		{
			if (!HistoryEntry.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FString& ActionId : AvailableActionIds)
		{
			if (ActionId.IsEmpty())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechProviderReceiptReviewShellProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReceiptReviewShellProfileId = TEXT("speech-provider-receipt-review-shell-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ShellKind = TEXT("operator-provider-receipt-review");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReceiptSurfaceMode = TEXT("posted-charge-review");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VarianceSurfaceMode = TEXT("estimate-versus-posted-charge");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RefreshActionId = TEXT("refresh-provider-receipt-review");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PostedChargeInspectActionId = TEXT("inspect-provider-posted-charges");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VarianceReviewActionId = TEXT("review-provider-charge-variance");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RouteInspectActionId = TEXT("inspect-provider-route");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString BudgetInspectActionId = TEXT("review-provider-budget");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RetainedReceiptEntryLimit = 12;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsReceiptTimeline = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsPostedChargeInspection = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsVarianceReview = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsEstimateOnlyFallback = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreservesFirstPartyReceiptInspectionOwnership = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellPanelLayout> Panels;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellActionBinding> ActionBindings;

	bool IsStructurallyValid() const
	{
		if (ReceiptReviewShellProfileId.IsEmpty()
			|| ShellKind.IsEmpty()
			|| ReceiptSurfaceMode.IsEmpty()
			|| VarianceSurfaceMode.IsEmpty()
			|| RefreshActionId.IsEmpty()
			|| PostedChargeInspectActionId.IsEmpty()
			|| VarianceReviewActionId.IsEmpty()
			|| RouteInspectActionId.IsEmpty()
			|| BudgetInspectActionId.IsEmpty()
			|| RetainedReceiptEntryLimit <= 0
			|| Panels.Num() <= 0
			|| ActionBindings.Num() <= 0)
		{
			return false;
		}

		for (const FHyperTwistSpeechShellPanelLayout& Panel : Panels)
		{
			if (!Panel.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechShellActionBinding& ActionBinding : ActionBindings)
		{
			if (!ActionBinding.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechProviderReceiptReviewEntry
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReceiptEntryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SourceKind = TEXT("history-derived-estimate-only");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HistoryEntryId = TEXT("speech-history-entry/current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UsageEventId = TEXT("speech-usage-event/current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CostEventId = TEXT("speech-cost-event/current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PricingSourceId = TEXT("first-party-estimate");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ChargeWindowId = TEXT("current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CapturedAtUtc = TEXT("2026-05-25T00:00:00Z");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float EstimatedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float ReportedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float AbsoluteVarianceUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VarianceDirectionId = TEXT("no-variance");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bHasProviderPostedCharge = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEstimateOnly = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bVarianceWithinTolerance = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresManualInspection = false;

	bool IsStructurallyValid() const
	{
		return !ReceiptEntryId.IsEmpty()
			&& !SourceKind.IsEmpty()
			&& !HistoryEntryId.IsEmpty()
			&& !UsageEventId.IsEmpty()
			&& !CostEventId.IsEmpty()
			&& !ProviderProfileId.IsEmpty()
			&& !ServiceLaneId.IsEmpty()
			&& !PricingSourceId.IsEmpty()
			&& !ChargeWindowId.IsEmpty()
			&& !CapturedAtUtc.IsEmpty()
			&& EstimatedCostUsd >= 0.0f
			&& ReportedCostUsd >= 0.0f
			&& AbsoluteVarianceUsd >= 0.0f
			&& !VarianceDirectionId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechProviderReceiptReviewIssue
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendedActionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresOperatorAttention = true;

	bool IsStructurallyValid() const
	{
		return !IssueId.IsEmpty()
			&& !IssueKind.IsEmpty()
			&& !StatusLine.IsEmpty()
			&& !DetailLine.IsEmpty()
			&& !RecommendedActionId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechProviderReceiptReviewShellState
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReceiptReviewShellProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveProviderDisplayLabel = TEXT("Local HTTP Speech Sidecar");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SelectedChargeWindowId = TEXT("current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PostedChargeInspectionModeId = TEXT("posted-charge-review");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestReceiptEntryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestSourceKind = TEXT("history-derived-estimate-only");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine = TEXT("Provider receipt review is ready for operator inspection.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine = TEXT("First-party receipt review remains bounded above retained usage/cost history and does not widen into settlement.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReceiptSummaryText;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ReceiptEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ProviderPostedChargeCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 EstimateOnlyEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 VarianceReviewEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float TotalEstimatedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float TotalReportedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float TotalAbsoluteVarianceUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float HighestAbsoluteVarianceUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bReceiptTimelineVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPostedChargeSummaryVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bVarianceReviewVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bReceiptSummaryReady = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPostedChargeInspectionReady = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bVarianceReviewReady = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ActiveIssueCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechProviderReceiptReviewIssue ActiveIssue;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechProviderReceiptReviewIssue> Issues;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechProviderReceiptReviewEntry> ReceiptEntries;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> AvailableActionIds;

	bool IsStructurallyValid() const
	{
		if (ReceiptReviewShellProfileId.IsEmpty()
			|| ActiveProviderProfileId.IsEmpty()
			|| ActiveProviderDisplayLabel.IsEmpty()
			|| ActiveServiceLaneId.IsEmpty()
			|| SelectedChargeWindowId.IsEmpty()
			|| PostedChargeInspectionModeId.IsEmpty()
			|| LatestSourceKind.IsEmpty()
			|| StatusLine.IsEmpty()
			|| DetailLine.IsEmpty()
			|| ReceiptEntryCount < 0
			|| ProviderPostedChargeCount < 0
			|| EstimateOnlyEntryCount < 0
			|| VarianceReviewEntryCount < 0
			|| TotalEstimatedCostUsd < 0.0f
			|| TotalReportedCostUsd < 0.0f
			|| TotalAbsoluteVarianceUsd < 0.0f
			|| HighestAbsoluteVarianceUsd < 0.0f
			|| ActiveIssueCount < 0
			|| AvailableActionIds.Num() <= 0)
		{
			return false;
		}

		if (ReceiptEntryCount != ReceiptEntries.Num()
			|| ProviderPostedChargeCount > ReceiptEntryCount
			|| EstimateOnlyEntryCount > ReceiptEntryCount
			|| VarianceReviewEntryCount > ReceiptEntryCount)
		{
			return false;
		}

		if (ReceiptEntryCount > 0 && LatestReceiptEntryId.IsEmpty())
		{
			return false;
		}

		if (bReceiptSummaryReady && ReceiptSummaryText.IsEmpty())
		{
			return false;
		}

		if (ActiveIssueCount != Issues.Num())
		{
			return false;
		}

		if (ActiveIssueCount > 0 && !ActiveIssue.IsStructurallyValid())
		{
			return false;
		}

		for (const FHyperTwistSpeechProviderReceiptReviewIssue& Issue : Issues)
		{
			if (!Issue.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechProviderReceiptReviewEntry& Entry : ReceiptEntries)
		{
			if (!Entry.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FString& ActionId : AvailableActionIds)
		{
			if (ActionId.IsEmpty())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechProviderBillingSettlementShellProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString BillingSettlementShellProfileId = TEXT("speech-provider-billing-settlement-shell-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ShellKind = TEXT("operator-provider-billing-settlement");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SettlementSurfaceMode = TEXT("posted-charge-settlement-assessment");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString InvoiceReconciliationMode = TEXT("estimate-versus-provider-invoice");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RefreshActionId = TEXT("refresh-provider-billing-settlement");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString InvoiceReconciliationActionId = TEXT("inspect-provider-invoice-reconciliation");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SettlementReadinessActionId = TEXT("review-provider-settlement-readiness");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RouteInspectActionId = TEXT("inspect-provider-route");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString BudgetInspectActionId = TEXT("review-provider-budget");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RetainedSettlementEntryLimit = 12;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsSettlementTimeline = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsInvoiceReconciliation = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsSettlementReadinessReview = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsEstimateOnlyFallback = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreservesFirstPartySettlementOwnership = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellPanelLayout> Panels;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellActionBinding> ActionBindings;

	bool IsStructurallyValid() const
	{
		if (BillingSettlementShellProfileId.IsEmpty()
			|| ShellKind.IsEmpty()
			|| SettlementSurfaceMode.IsEmpty()
			|| InvoiceReconciliationMode.IsEmpty()
			|| RefreshActionId.IsEmpty()
			|| InvoiceReconciliationActionId.IsEmpty()
			|| SettlementReadinessActionId.IsEmpty()
			|| RouteInspectActionId.IsEmpty()
			|| BudgetInspectActionId.IsEmpty()
			|| RetainedSettlementEntryLimit <= 0
			|| Panels.Num() <= 0
			|| ActionBindings.Num() <= 0)
		{
			return false;
		}

		for (const FHyperTwistSpeechShellPanelLayout& Panel : Panels)
		{
			if (!Panel.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechShellActionBinding& ActionBinding : ActionBindings)
		{
			if (!ActionBinding.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechProviderBillingSettlementEntry
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SettlementEntryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SourceKind = TEXT("receipt-review-derived-estimate-only");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReceiptEntryId = TEXT("speech-provider-receipt-entry/current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HistoryEntryId = TEXT("speech-history-entry/current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PricingSourceId = TEXT("first-party-estimate");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ChargeWindowId = TEXT("current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SettlementWindowId = TEXT("current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CapturedAtUtc = TEXT("2026-05-25T00:00:00Z");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float EstimatedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float ReportedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float SettlementDeltaUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SettlementStateId = TEXT("awaiting-provider-posted-charge");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString InvoiceReconciliationStateId = TEXT("invoice-pending");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bHasProviderPostedCharge = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bInvoiceReconciliationReady = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresManualReview = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSettlementBlocked = true;

	bool IsStructurallyValid() const
	{
		return !SettlementEntryId.IsEmpty()
			&& !SourceKind.IsEmpty()
			&& !ReceiptEntryId.IsEmpty()
			&& !HistoryEntryId.IsEmpty()
			&& !ProviderProfileId.IsEmpty()
			&& !ServiceLaneId.IsEmpty()
			&& !PricingSourceId.IsEmpty()
			&& !ChargeWindowId.IsEmpty()
			&& !SettlementWindowId.IsEmpty()
			&& !CapturedAtUtc.IsEmpty()
			&& EstimatedCostUsd >= 0.0f
			&& ReportedCostUsd >= 0.0f
			&& SettlementDeltaUsd >= 0.0f
			&& !SettlementStateId.IsEmpty()
			&& !InvoiceReconciliationStateId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechProviderBillingSettlementIssue
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendedActionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresOperatorAttention = true;

	bool IsStructurallyValid() const
	{
		return !IssueId.IsEmpty()
			&& !IssueKind.IsEmpty()
			&& !StatusLine.IsEmpty()
			&& !DetailLine.IsEmpty()
			&& !RecommendedActionId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechProviderBillingSettlementShellState
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString BillingSettlementShellProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveProviderDisplayLabel = TEXT("Local HTTP Speech Sidecar");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SelectedSettlementWindowId = TEXT("current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SettlementSurfaceModeId = TEXT("posted-charge-settlement-assessment");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString InvoiceReconciliationModeId = TEXT("estimate-versus-provider-invoice");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestSettlementEntryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestSourceKind = TEXT("receipt-review-derived-estimate-only");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine = TEXT("Provider billing settlement posture is ready for bounded inspection.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine = TEXT("First-party settlement posture remains bounded above retained receipt review and does not widen into payment execution.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SettlementSummaryText;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 SettlementEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ProviderPostedChargeCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ReconciliationReadyEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 EstimateOnlyEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ManualReviewEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 BlockedSettlementEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float TotalEstimatedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float TotalReportedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float TotalSettlementDeltaUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float HighestSettlementDeltaUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSettlementTimelineVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bInvoiceReconciliationVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSettlementReadinessVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSettlementSummaryReady = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bInvoiceReconciliationReady = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSettlementReadinessReviewReady = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ActiveIssueCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechProviderBillingSettlementIssue ActiveIssue;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechProviderBillingSettlementIssue> Issues;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechProviderBillingSettlementEntry> SettlementEntries;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> AvailableActionIds;

	bool IsStructurallyValid() const
	{
		if (BillingSettlementShellProfileId.IsEmpty()
			|| ActiveProviderProfileId.IsEmpty()
			|| ActiveProviderDisplayLabel.IsEmpty()
			|| ActiveServiceLaneId.IsEmpty()
			|| SelectedSettlementWindowId.IsEmpty()
			|| SettlementSurfaceModeId.IsEmpty()
			|| InvoiceReconciliationModeId.IsEmpty()
			|| LatestSourceKind.IsEmpty()
			|| StatusLine.IsEmpty()
			|| DetailLine.IsEmpty()
			|| SettlementEntryCount < 0
			|| ProviderPostedChargeCount < 0
			|| ReconciliationReadyEntryCount < 0
			|| EstimateOnlyEntryCount < 0
			|| ManualReviewEntryCount < 0
			|| BlockedSettlementEntryCount < 0
			|| TotalEstimatedCostUsd < 0.0f
			|| TotalReportedCostUsd < 0.0f
			|| TotalSettlementDeltaUsd < 0.0f
			|| HighestSettlementDeltaUsd < 0.0f
			|| ActiveIssueCount < 0
			|| AvailableActionIds.Num() <= 0)
		{
			return false;
		}

		if (SettlementEntryCount != SettlementEntries.Num()
			|| ProviderPostedChargeCount > SettlementEntryCount
			|| ReconciliationReadyEntryCount > SettlementEntryCount
			|| EstimateOnlyEntryCount > SettlementEntryCount
			|| ManualReviewEntryCount > SettlementEntryCount
			|| BlockedSettlementEntryCount > SettlementEntryCount)
		{
			return false;
		}

		if (SettlementEntryCount > 0 && LatestSettlementEntryId.IsEmpty())
		{
			return false;
		}

		if (bSettlementSummaryReady && SettlementSummaryText.IsEmpty())
		{
			return false;
		}

		if (ActiveIssueCount != Issues.Num())
		{
			return false;
		}

		if (ActiveIssueCount > 0 && !ActiveIssue.IsStructurallyValid())
		{
			return false;
		}

		for (const FHyperTwistSpeechProviderBillingSettlementIssue& Issue : Issues)
		{
			if (!Issue.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechProviderBillingSettlementEntry& Entry : SettlementEntries)
		{
			if (!Entry.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FString& ActionId : AvailableActionIds)
		{
			if (ActionId.IsEmpty())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechProviderSettlementExceptionShellProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SettlementExceptionShellProfileId =
		TEXT("speech-provider-settlement-exception-shell-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ShellKind = TEXT("operator-provider-settlement-exception");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExceptionSurfaceMode = TEXT("settlement-exception-triage");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExternalPortalHandoffMode = TEXT("reference-only-provider-portal-handoff");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RefreshActionId = TEXT("refresh-provider-settlement-exceptions");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExceptionInspectActionId = TEXT("inspect-provider-settlement-exception");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExternalPortalHandoffActionId =
		TEXT("review-provider-external-portal-handoff");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RouteInspectActionId = TEXT("inspect-provider-route");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString BudgetInspectActionId = TEXT("review-provider-budget");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RetainedExceptionEntryLimit = 12;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsExceptionTimeline = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsExternalPortalHandoff = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsSettlementExceptionReview = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsPendingChargeExceptions = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreservesFirstPartyHandoffOwnership = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellPanelLayout> Panels;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellActionBinding> ActionBindings;

	bool IsStructurallyValid() const
	{
		if (SettlementExceptionShellProfileId.IsEmpty()
			|| ShellKind.IsEmpty()
			|| ExceptionSurfaceMode.IsEmpty()
			|| ExternalPortalHandoffMode.IsEmpty()
			|| RefreshActionId.IsEmpty()
			|| ExceptionInspectActionId.IsEmpty()
			|| ExternalPortalHandoffActionId.IsEmpty()
			|| RouteInspectActionId.IsEmpty()
			|| BudgetInspectActionId.IsEmpty()
			|| RetainedExceptionEntryLimit <= 0
			|| Panels.Num() <= 0
			|| ActionBindings.Num() <= 0)
		{
			return false;
		}

		for (const FHyperTwistSpeechShellPanelLayout& Panel : Panels)
		{
			if (!Panel.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechShellActionBinding& ActionBinding : ActionBindings)
		{
			if (!ActionBinding.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechProviderSettlementExceptionEntry
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExceptionEntryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SourceKind = TEXT("settlement-derived-pending-charge");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SettlementEntryId = TEXT("speech-provider-settlement-entry/current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReceiptEntryId = TEXT("speech-provider-receipt-entry/current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HistoryEntryId = TEXT("speech-history-entry/current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExceptionKindId = TEXT("provider-charge-pending");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HandoffTargetId = TEXT("external-provider-portal");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HandoffStateId = TEXT("handoff-deferred-until-provider-posted-charge");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CapturedAtUtc = TEXT("2026-05-25T00:00:00Z");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float EstimatedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float ReportedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float SettlementDeltaUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresManualReview = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bExternalPortalHandoffReady = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSettlementBlocked = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresOperatorAttention = false;

	bool IsStructurallyValid() const
	{
		return !ExceptionEntryId.IsEmpty()
			&& !SourceKind.IsEmpty()
			&& !SettlementEntryId.IsEmpty()
			&& !ReceiptEntryId.IsEmpty()
			&& !HistoryEntryId.IsEmpty()
			&& !ProviderProfileId.IsEmpty()
			&& !ServiceLaneId.IsEmpty()
			&& !ExceptionKindId.IsEmpty()
			&& !HandoffTargetId.IsEmpty()
			&& !HandoffStateId.IsEmpty()
			&& !CapturedAtUtc.IsEmpty()
			&& EstimatedCostUsd >= 0.0f
			&& ReportedCostUsd >= 0.0f
			&& SettlementDeltaUsd >= 0.0f;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechProviderSettlementExceptionIssue
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendedActionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresOperatorAttention = true;

	bool IsStructurallyValid() const
	{
		return !IssueId.IsEmpty()
			&& !IssueKind.IsEmpty()
			&& !StatusLine.IsEmpty()
			&& !DetailLine.IsEmpty()
			&& !RecommendedActionId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechProviderSettlementExceptionShellState
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SettlementExceptionShellProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveProviderDisplayLabel = TEXT("Local HTTP Speech Sidecar");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SelectedSettlementWindowId = TEXT("current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExceptionSurfaceModeId = TEXT("settlement-exception-triage");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExternalPortalHandoffModeId = TEXT("reference-only-provider-portal-handoff");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestExceptionEntryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestSourceKind = TEXT("settlement-derived-pending-charge");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine = TEXT("Provider settlement exceptions are ready for bounded inspection.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine = TEXT("First-party settlement exception posture remains bounded above retained settlement review and only exposes reference handoff surfaces.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExceptionSummaryText;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ExceptionEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ExternalPortalHandoffReadyEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 PendingChargeEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ManualReviewEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RouteDegradedEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 BlockedSettlementEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float TotalEstimatedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float TotalReportedCostUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float TotalSettlementDeltaUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float HighestSettlementDeltaUsd = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bExceptionTimelineVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bExternalPortalHandoffVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bExceptionReviewVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bExceptionSummaryReady = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bExternalPortalHandoffReady = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSettlementExceptionReviewReady = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ActiveIssueCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechProviderSettlementExceptionIssue ActiveIssue;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechProviderSettlementExceptionIssue> Issues;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechProviderSettlementExceptionEntry> ExceptionEntries;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> AvailableActionIds;

	bool IsStructurallyValid() const
	{
		if (SettlementExceptionShellProfileId.IsEmpty()
			|| ActiveProviderProfileId.IsEmpty()
			|| ActiveProviderDisplayLabel.IsEmpty()
			|| ActiveServiceLaneId.IsEmpty()
			|| SelectedSettlementWindowId.IsEmpty()
			|| ExceptionSurfaceModeId.IsEmpty()
			|| ExternalPortalHandoffModeId.IsEmpty()
			|| LatestSourceKind.IsEmpty()
			|| StatusLine.IsEmpty()
			|| DetailLine.IsEmpty()
			|| ExceptionEntryCount < 0
			|| ExternalPortalHandoffReadyEntryCount < 0
			|| PendingChargeEntryCount < 0
			|| ManualReviewEntryCount < 0
			|| RouteDegradedEntryCount < 0
			|| BlockedSettlementEntryCount < 0
			|| TotalEstimatedCostUsd < 0.0f
			|| TotalReportedCostUsd < 0.0f
			|| TotalSettlementDeltaUsd < 0.0f
			|| HighestSettlementDeltaUsd < 0.0f
			|| ActiveIssueCount < 0
			|| AvailableActionIds.Num() <= 0)
		{
			return false;
		}

		if (ExceptionEntryCount != ExceptionEntries.Num()
			|| ExternalPortalHandoffReadyEntryCount > ExceptionEntryCount
			|| PendingChargeEntryCount > ExceptionEntryCount
			|| ManualReviewEntryCount > ExceptionEntryCount
			|| RouteDegradedEntryCount > ExceptionEntryCount
			|| BlockedSettlementEntryCount > ExceptionEntryCount)
		{
			return false;
		}

		if (ExceptionEntryCount > 0 && LatestExceptionEntryId.IsEmpty())
		{
			return false;
		}

		if (bExceptionSummaryReady && ExceptionSummaryText.IsEmpty())
		{
			return false;
		}

		if (ActiveIssueCount != Issues.Num())
		{
			return false;
		}

		if (ActiveIssueCount > 0 && !ActiveIssue.IsStructurallyValid())
		{
			return false;
		}

		for (const FHyperTwistSpeechProviderSettlementExceptionIssue& Issue : Issues)
		{
			if (!Issue.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechProviderSettlementExceptionEntry& Entry : ExceptionEntries)
		{
			if (!Entry.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FString& ActionId : AvailableActionIds)
		{
			if (ActionId.IsEmpty())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechExternalDictationOutputRouteOption
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OutputRouteId = TEXT("clipboard-paste");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DisplayLabel = TEXT("Paste to active app");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DeliveryModeId = TEXT("clipboard-paste");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DispatchTargetId = TEXT("active-clipboard-target");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString InputGestureHint = TEXT("Ctrl+Shift+V");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRouteSelectable = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bDefaultSelected = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresFocusedDesktopTarget = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsTranscriptPostProcess = true;

	bool IsStructurallyValid() const
	{
		return !OutputRouteId.IsEmpty()
			&& !DisplayLabel.IsEmpty()
			&& !DeliveryModeId.IsEmpty()
			&& !DispatchTargetId.IsEmpty()
			&& !InputGestureHint.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechExternalDictationHistoryEntry
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString HistoryEntryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SourceKind = TEXT("final-transcript");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionId = TEXT("speech-session-default");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UtteranceId = TEXT("speech-utterance/current-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CapturedAtUtc = TEXT("2026-05-31T00:00:00Z");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TranscriptText;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PostProcessedText;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OutputRouteId = TEXT("clipboard-paste");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bIsFinal = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPostProcessed = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSaved = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bClipboardReady = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bTypingReady = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bScriptDispatchReady = true;

	bool IsStructurallyValid() const
	{
		return !HistoryEntryId.IsEmpty()
			&& !SourceKind.IsEmpty()
			&& !SessionId.IsEmpty()
			&& !UtteranceId.IsEmpty()
			&& !ProviderProfileId.IsEmpty()
			&& !ServiceLaneId.IsEmpty()
			&& !CapturedAtUtc.IsEmpty()
			&& !TranscriptText.IsEmpty()
			&& !OutputRouteId.IsEmpty()
			&& (!bPostProcessed || !PostProcessedText.IsEmpty());
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechExternalDictationShellIssue
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IssueKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RecommendedActionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresOperatorAttention = true;

	bool IsStructurallyValid() const
	{
		return !IssueId.IsEmpty()
			&& !IssueKind.IsEmpty()
			&& !StatusLine.IsEmpty()
			&& !DetailLine.IsEmpty()
			&& !RecommendedActionId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechExternalDictationDeviceOption
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DeviceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DisplayLabel;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DeviceRoleId = TEXT("input");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bDefaultRoute = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSelectedRoute = false;

	bool IsStructurallyValid() const
	{
		return !DeviceId.IsEmpty() && !DisplayLabel.IsEmpty() && !DeviceRoleId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechExternalDictationModelCatalogEntry
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PayloadId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DisplayLabel;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PayloadKind = TEXT("whisper-ggml-model");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SelectionPolicyId = TEXT("primary-transcription-model");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AcquisitionMode = TEXT("manual-download-or-convert");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IntegrityCheckKind;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString IntegrityCheckValue;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RelativePathHint;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StoragePostureId = TEXT("user-managed-local-cache");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UnloadPolicyId = TEXT("manual-unload-out-of-packet");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ApproximateSizeMiB = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bOptionalForSession = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSelectedPrimaryPayload = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bDownloadDeferredInCurrentPacket = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bIntegrityReviewRequired = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUnloadActionDeferredInCurrentPacket = true;

	bool IsStructurallyValid() const
	{
		return !PayloadId.IsEmpty()
			&& !DisplayLabel.IsEmpty()
			&& !PayloadKind.IsEmpty()
			&& !SelectionPolicyId.IsEmpty()
			&& !AcquisitionMode.IsEmpty()
			&& !RelativePathHint.IsEmpty()
			&& !StoragePostureId.IsEmpty()
			&& !UnloadPolicyId.IsEmpty()
			&& ApproximateSizeMiB > 0
			&& (IntegrityCheckKind.IsEmpty() == IntegrityCheckValue.IsEmpty());
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechExternalDictationShellProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExternalDictationShellProfileId = TEXT("speech-external-dictation-shell-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ShellKind = TEXT("operator-external-dictation-shell");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TranscriptHistorySurfaceMode = TEXT("rolling-transcript-history");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OutputRoutingSurfaceMode = TEXT("clipboard-typing-script-routing");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PostProcessOverlaySurfaceMode = TEXT("transcript-post-process-overlay");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString GlobalHotkeySurfaceMode = TEXT("platform-scoped-dictation-shortcut-lifecycle");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString InputDeviceSurfaceMode = TEXT("selected-input-device-cycle");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OutputDeviceSurfaceMode = TEXT("selected-output-device-cycle");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString MuteSurfaceMode = TEXT("mute-while-recording-toggle");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString MicrophoneModeSurfaceMode = TEXT("lazy-close-and-always-on-mode");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LocalModelCatalogSurfaceMode = TEXT("local-model-catalog-review");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ModelIntegritySurfaceMode = TEXT("payload-integrity-review");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ModelUnloadSurfaceMode = TEXT("sidecar-model-unload-policy");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StartCaptureActionId = TEXT("start-external-dictation-capture");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CancelCaptureActionId = TEXT("cancel-external-dictation-capture");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CycleOutputRouteActionId = TEXT("cycle-external-dictation-output-route");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CopyTranscriptActionId = TEXT("copy-latest-dictation-transcript");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PasteTranscriptActionId = TEXT("paste-latest-dictation-transcript");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ScriptDispatchActionId = TEXT("dispatch-dictation-script-output");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TogglePostProcessOverlayActionId =
		TEXT("toggle-dictation-post-process-overlay");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReopenSpeechSessionActionId = TEXT("reopen-speech-session");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RouteInspectActionId = TEXT("inspect-provider-route");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString InspectGlobalHotkeyActionId = TEXT("inspect-dictation-global-hotkey");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CycleInputDeviceActionId = TEXT("cycle-dictation-input-device");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CycleOutputDeviceActionId = TEXT("cycle-dictation-output-device");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ToggleMuteWhileRecordingActionId =
		TEXT("toggle-dictation-mute-while-recording");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ToggleMicrophoneModeActionId = TEXT("toggle-dictation-microphone-mode");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString InspectLocalModelCatalogActionId = TEXT("inspect-local-model-catalog");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReviewLocalModelIntegrityActionId = TEXT("review-local-model-integrity");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReviewLocalModelUnloadPolicyActionId = TEXT("review-local-model-unload-policy");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PrimaryHotkeyBindingLabel = TEXT("ctrl+space");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PostProcessHotkeyBindingLabel = TEXT("ctrl+shift+space");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RetainedHistoryEntryLimit = 12;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsTranscriptHistoryTimeline = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsClipboardRouting = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsTypingRouting = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsScriptDispatchRouting = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsTranscriptPostProcessOverlay = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsGlobalHotkeyLifecycle = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsInputDeviceSelection = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsOutputDeviceSelection = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsMuteWhileRecordingToggle = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsAlwaysOnMicrophoneMode = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsClamshellInputFallback = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsLazyCloseLifecycle = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsLocalModelCatalogReview = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsModelIntegrityReview = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsModelUnloadPolicyReview = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellPanelLayout> Panels;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechShellActionBinding> ActionBindings;

	bool IsStructurallyValid() const
	{
		if (ExternalDictationShellProfileId.IsEmpty()
			|| ShellKind.IsEmpty()
			|| TranscriptHistorySurfaceMode.IsEmpty()
			|| OutputRoutingSurfaceMode.IsEmpty()
			|| PostProcessOverlaySurfaceMode.IsEmpty()
			|| GlobalHotkeySurfaceMode.IsEmpty()
			|| InputDeviceSurfaceMode.IsEmpty()
			|| OutputDeviceSurfaceMode.IsEmpty()
			|| MuteSurfaceMode.IsEmpty()
			|| MicrophoneModeSurfaceMode.IsEmpty()
			|| LocalModelCatalogSurfaceMode.IsEmpty()
			|| ModelIntegritySurfaceMode.IsEmpty()
			|| ModelUnloadSurfaceMode.IsEmpty()
			|| StartCaptureActionId.IsEmpty()
			|| CancelCaptureActionId.IsEmpty()
			|| CycleOutputRouteActionId.IsEmpty()
			|| CopyTranscriptActionId.IsEmpty()
			|| PasteTranscriptActionId.IsEmpty()
			|| ScriptDispatchActionId.IsEmpty()
			|| TogglePostProcessOverlayActionId.IsEmpty()
			|| ReopenSpeechSessionActionId.IsEmpty()
			|| RouteInspectActionId.IsEmpty()
			|| InspectGlobalHotkeyActionId.IsEmpty()
			|| CycleInputDeviceActionId.IsEmpty()
			|| CycleOutputDeviceActionId.IsEmpty()
			|| ToggleMuteWhileRecordingActionId.IsEmpty()
			|| ToggleMicrophoneModeActionId.IsEmpty()
			|| InspectLocalModelCatalogActionId.IsEmpty()
			|| ReviewLocalModelIntegrityActionId.IsEmpty()
			|| ReviewLocalModelUnloadPolicyActionId.IsEmpty()
			|| PrimaryHotkeyBindingLabel.IsEmpty()
			|| PostProcessHotkeyBindingLabel.IsEmpty()
			|| RetainedHistoryEntryLimit <= 0
			|| Panels.Num() <= 0
			|| ActionBindings.Num() <= 0)
		{
			return false;
		}

		for (const FHyperTwistSpeechShellPanelLayout& Panel : Panels)
		{
			if (!Panel.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechShellActionBinding& ActionBinding : ActionBindings)
		{
			if (!ActionBinding.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechExternalDictationShellState
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExternalDictationShellProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ActiveServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SelectedOutputRouteId = TEXT("clipboard-paste");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TranscriptHistorySurfaceModeId = TEXT("rolling-transcript-history");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OutputRoutingSurfaceModeId = TEXT("clipboard-typing-script-routing");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PostProcessOverlaySurfaceModeId = TEXT("transcript-post-process-overlay");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString GlobalHotkeySurfaceModeId = TEXT("platform-scoped-dictation-shortcut-lifecycle");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString InputDeviceSurfaceModeId = TEXT("selected-input-device-cycle");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OutputDeviceSurfaceModeId = TEXT("selected-output-device-cycle");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString MuteSurfaceModeId = TEXT("mute-while-recording-toggle");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString MicrophoneModeSurfaceModeId = TEXT("lazy-close-and-always-on-mode");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LocalModelCatalogSurfaceModeId = TEXT("local-model-catalog-review");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ModelIntegritySurfaceModeId = TEXT("payload-integrity-review");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ModelUnloadSurfaceModeId = TEXT("sidecar-model-unload-policy");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestHistoryEntryId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestSourceKind = TEXT("shell-cleared");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString StatusLine = TEXT("External dictation shell ready for bounded transcript routing.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DetailLine = TEXT("The bounded dictation shell stays above the landed speech stack and does not displace provider/session ownership.");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestTranscriptText;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LatestPostProcessedText;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PrimaryHotkeyBindingLabel = TEXT("ctrl+space");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PostProcessHotkeyBindingLabel = TEXT("ctrl+shift+space");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SelectedInputDeviceId = TEXT("system-default-input");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SelectedInputDeviceLabel = TEXT("System default microphone");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SelectedOutputDeviceId = TEXT("system-default-output");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SelectedOutputDeviceLabel = TEXT("System default output device");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString MicrophoneModeId = TEXT("on-demand");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PayloadCustodyProfileId = TEXT("downloadable-model-payload-custody-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SelectedPrimaryPayloadId = TEXT("speech-model/whisper.cpp/base.en");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 HistoryEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 PostProcessedEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 SavedEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ModelCatalogEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 OptionalModelCatalogEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 DownloadDeferredModelEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 IntegrityReviewRequiredEntryCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bShellVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bTranscriptHistoryVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bOutputRoutingVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPostProcessOverlayVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bGlobalHotkeyVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bInputDeviceSelectionVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bOutputDeviceSelectionVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bMuteWhileRecordingVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bMicrophoneModeVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bLocalModelCatalogVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bModelIntegrityVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bModelUnloadPolicyVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bClamshellInputFallbackVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bLazyCloseLifecycleVisible = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPushToTalkReady = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bCaptureInFlight = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bCancelVisible = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bOutputRoutingReady = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bClipboardRouteAvailable = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bTypingRouteAvailable = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bScriptRouteAvailable = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPostProcessOverlayEnabled = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPushToTalkMode = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bMuteWhileRecordingEnabled = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bCatalogReady = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRuntimeDownloadDeferred = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bBundledPayloadRedistributionDeferred = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsUserManagedPayloads = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsSidecarManagedPayloads = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bIntegrityVerificationRequired = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUnloadActionsDeferredToSidecar = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bLatestEntryReadyForDispatch = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ActiveIssueCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechExternalDictationShellIssue ActiveIssue;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechExternalDictationShellIssue> Issues;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechExternalDictationHistoryEntry> HistoryEntries;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechExternalDictationOutputRouteOption> OutputRouteOptions;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechExternalDictationDeviceOption> InputDeviceOptions;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechExternalDictationDeviceOption> OutputDeviceOptions;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechExternalDictationModelCatalogEntry> ModelCatalogEntries;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> AvailableActionIds;

	FString LastRecordedSignature;

	bool IsStructurallyValid() const
	{
		if (ExternalDictationShellProfileId.IsEmpty()
			|| ActiveProviderProfileId.IsEmpty()
			|| ActiveServiceLaneId.IsEmpty()
			|| SelectedOutputRouteId.IsEmpty()
			|| TranscriptHistorySurfaceModeId.IsEmpty()
			|| OutputRoutingSurfaceModeId.IsEmpty()
			|| PostProcessOverlaySurfaceModeId.IsEmpty()
			|| GlobalHotkeySurfaceModeId.IsEmpty()
			|| InputDeviceSurfaceModeId.IsEmpty()
			|| OutputDeviceSurfaceModeId.IsEmpty()
			|| MuteSurfaceModeId.IsEmpty()
			|| MicrophoneModeSurfaceModeId.IsEmpty()
			|| LocalModelCatalogSurfaceModeId.IsEmpty()
			|| ModelIntegritySurfaceModeId.IsEmpty()
			|| ModelUnloadSurfaceModeId.IsEmpty()
			|| LatestSourceKind.IsEmpty()
			|| StatusLine.IsEmpty()
			|| DetailLine.IsEmpty()
			|| PrimaryHotkeyBindingLabel.IsEmpty()
			|| PostProcessHotkeyBindingLabel.IsEmpty()
			|| SelectedInputDeviceId.IsEmpty()
			|| SelectedInputDeviceLabel.IsEmpty()
			|| SelectedOutputDeviceId.IsEmpty()
			|| SelectedOutputDeviceLabel.IsEmpty()
			|| MicrophoneModeId.IsEmpty()
			|| PayloadCustodyProfileId.IsEmpty()
			|| SelectedPrimaryPayloadId.IsEmpty()
			|| HistoryEntryCount < 0
			|| PostProcessedEntryCount < 0
			|| SavedEntryCount < 0
			|| ModelCatalogEntryCount < 0
			|| OptionalModelCatalogEntryCount < 0
			|| DownloadDeferredModelEntryCount < 0
			|| IntegrityReviewRequiredEntryCount < 0
			|| ActiveIssueCount < 0
			|| OutputRouteOptions.Num() <= 0
			|| InputDeviceOptions.Num() <= 0
			|| OutputDeviceOptions.Num() <= 0
			|| ModelCatalogEntries.Num() <= 0
			|| AvailableActionIds.Num() <= 0)
		{
			return false;
		}

		if (HistoryEntryCount != HistoryEntries.Num()
			|| PostProcessedEntryCount > HistoryEntryCount
			|| SavedEntryCount > HistoryEntryCount
			|| ModelCatalogEntryCount != ModelCatalogEntries.Num()
			|| OptionalModelCatalogEntryCount > ModelCatalogEntryCount
			|| DownloadDeferredModelEntryCount > ModelCatalogEntryCount
			|| IntegrityReviewRequiredEntryCount > ModelCatalogEntryCount)
		{
			return false;
		}

		if (HistoryEntryCount > 0
			&& (LatestHistoryEntryId.IsEmpty() || LatestTranscriptText.IsEmpty()))
		{
			return false;
		}

		if (ActiveIssueCount != Issues.Num())
		{
			return false;
		}

		if (ActiveIssueCount > 0 && !ActiveIssue.IsStructurallyValid())
		{
			return false;
		}

		for (const FHyperTwistSpeechExternalDictationShellIssue& Issue : Issues)
		{
			if (!Issue.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechExternalDictationHistoryEntry& Entry : HistoryEntries)
		{
			if (!Entry.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechExternalDictationOutputRouteOption& OutputRouteOption :
			OutputRouteOptions)
		{
			if (!OutputRouteOption.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechExternalDictationDeviceOption& DeviceOption :
			InputDeviceOptions)
		{
			if (!DeviceOption.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechExternalDictationDeviceOption& DeviceOption :
			OutputDeviceOptions)
		{
			if (!DeviceOption.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechExternalDictationModelCatalogEntry& CatalogEntry :
			ModelCatalogEntries)
		{
			if (!CatalogEntry.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FString& ActionId : AvailableActionIds)
		{
			if (ActionId.IsEmpty())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechSessionConfig
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ListeningContractId = TEXT("listening-threshold-lifecycle");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString InputRouteId = TEXT("queue/listening");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AudioEncoding = TEXT("pcm-f32le-16khz-mono");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 SampleRateHz = 16000;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ChannelCount = 1;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LanguageMode = TEXT("auto");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TaskKind = TEXT("transcribe");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString GrammarProfileId = TEXT("coach-command-grammar-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString MicrophoneShellProfileId = TEXT("coach-command-microphone-shell-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechMicrophoneShellProfile MicrophoneShellProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DevicePermissionWorkflowProfileId =
		TEXT("speech-device-permission-workflow-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechDevicePermissionWorkflowProfile
		DevicePermissionWorkflowProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString NativeCaptureRouteWorkflowProfileId =
		TEXT("speech-native-capture-route-workflow-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechNativeCaptureRouteWorkflowProfile
		NativeCaptureRouteWorkflowProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString NativeCaptureRouteShellProfileId =
		TEXT("speech-native-capture-route-shell-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechNativeCaptureRouteShellProfile
		NativeCaptureRouteShellProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ExternalDictationShellProfileId = TEXT("speech-external-dictation-shell-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechExternalDictationShellProfile
		ExternalDictationShellProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechProviderProfile ProviderProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ByokCustodyProfileId = TEXT("speech-byok-custody-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechByokCustodyProfile ByokCustodyProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderRoutingPolicyId = TEXT("speech-provider-routing/provider-backed-sidecar-first-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechProviderRoutingPolicy ProviderRoutingPolicyDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechProviderRouteDecision ProviderRouteDecision;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UsageCostAccountingProfileId = TEXT("speech-usage-cost-accounting-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechUsageCostAccountingProfile UsageCostAccountingProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechNormalizedUsageEvent UsageEventTemplate;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechNormalizedCostEvent CostEventTemplate;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UsageCostDashboardShellProfileId = TEXT("speech-provider-usage-cost-dashboard-shell-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechUsageCostDashboardShellProfile UsageCostDashboardShellProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UsageCostHistoryExportShellProfileId =
		TEXT("speech-provider-usage-cost-history-export-shell-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechUsageCostHistoryExportShellProfile
		UsageCostHistoryExportShellProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderReceiptReviewShellProfileId =
		TEXT("speech-provider-receipt-review-shell-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechProviderReceiptReviewShellProfile
		ProviderReceiptReviewShellProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderBillingSettlementShellProfileId =
		TEXT("speech-provider-billing-settlement-shell-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechProviderBillingSettlementShellProfile
		ProviderBillingSettlementShellProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderSettlementExceptionShellProfileId =
		TEXT("speech-provider-settlement-exception-shell-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechProviderSettlementExceptionShellProfile
		ProviderSettlementExceptionShellProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PayloadCustodyProfileId = TEXT("downloadable-model-payload-custody-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechPayloadCustodyProfile PayloadCustodyProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechModelPayloadDescriptor> RequiredModelPayloads;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEnableVad = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEnableWordTimestamps = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechVadPolicy VadPolicy;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> CommandHints;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechTranscriptionOrchestrationProfile OrchestrationProfile;

	bool IsStructurallyValid() const
	{
		if (SessionId.IsEmpty()
			|| ListeningContractId.IsEmpty()
			|| InputRouteId.IsEmpty()
			|| AudioEncoding.IsEmpty()
			|| SampleRateHz <= 0
			|| ChannelCount <= 0
			|| TaskKind.IsEmpty()
			|| MicrophoneShellProfileId.IsEmpty()
			|| !MicrophoneShellProfileDefinition.IsStructurallyValid()
			|| DevicePermissionWorkflowProfileId.IsEmpty()
			|| !DevicePermissionWorkflowProfileDefinition.IsStructurallyValid()
			|| NativeCaptureRouteWorkflowProfileId.IsEmpty()
			|| !NativeCaptureRouteWorkflowProfileDefinition.IsStructurallyValid()
			|| NativeCaptureRouteShellProfileId.IsEmpty()
			|| !NativeCaptureRouteShellProfileDefinition.IsStructurallyValid()
			|| ExternalDictationShellProfileId.IsEmpty()
			|| !ExternalDictationShellProfileDefinition.IsStructurallyValid()
			|| ProviderProfileId.IsEmpty()
			|| !ProviderProfileDefinition.IsStructurallyValid()
			|| ByokCustodyProfileId.IsEmpty()
			|| !ByokCustodyProfileDefinition.IsStructurallyValid()
			|| ProviderRoutingPolicyId.IsEmpty()
			|| !ProviderRoutingPolicyDefinition.IsStructurallyValid()
			|| !ProviderRouteDecision.IsStructurallyValid()
			|| UsageCostAccountingProfileId.IsEmpty()
			|| !UsageCostAccountingProfileDefinition.IsStructurallyValid()
			|| !UsageEventTemplate.IsStructurallyValid()
			|| !CostEventTemplate.IsStructurallyValid()
			|| UsageCostDashboardShellProfileId.IsEmpty()
			|| !UsageCostDashboardShellProfileDefinition.IsStructurallyValid()
			|| UsageCostHistoryExportShellProfileId.IsEmpty()
			|| !UsageCostHistoryExportShellProfileDefinition.IsStructurallyValid()
			|| ProviderReceiptReviewShellProfileId.IsEmpty()
			|| !ProviderReceiptReviewShellProfileDefinition.IsStructurallyValid()
			|| ProviderBillingSettlementShellProfileId.IsEmpty()
			|| !ProviderBillingSettlementShellProfileDefinition.IsStructurallyValid()
			|| ProviderSettlementExceptionShellProfileId.IsEmpty()
			|| !ProviderSettlementExceptionShellProfileDefinition.IsStructurallyValid()
			|| PayloadCustodyProfileId.IsEmpty()
			|| !PayloadCustodyProfileDefinition.IsStructurallyValid()
			|| RequiredModelPayloads.Num() <= 0
			|| !VadPolicy.IsStructurallyValid()
			|| !OrchestrationProfile.IsStructurallyValid())
		{
			return false;
		}

		for (const FHyperTwistSpeechModelPayloadDescriptor& Payload : RequiredModelPayloads)
		{
			if (!Payload.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechUtteranceEnvelope
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UtteranceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CapturedAtUtc;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AudioRef;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 SourceTimestampMs = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 SampleCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 SampleRateHz = 16000;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ChannelCount = 1;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 SpeechStartMs = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 SpeechEndMs = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 SilenceGapMs = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float EnergyThreshold = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> LocalCommandHints;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSpeechCommitReady = true;

	bool IsStructurallyValid() const
	{
		return !SessionId.IsEmpty()
			&& !UtteranceId.IsEmpty()
			&& SampleRateHz > 0
			&& ChannelCount > 0
			&& SpeechStartMs >= 0
			&& SpeechEndMs >= SpeechStartMs
			&& SilenceGapMs >= 0;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechTranscriptSegment
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 SegmentOrdinal = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Text;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 StartMs = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 EndMs = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float Confidence = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float NoSpeechProbability = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bGrammarConstrained = false;

	bool IsStructurallyValid() const
	{
		return SegmentOrdinal >= 0
			&& !Text.IsEmpty()
			&& StartMs >= 0
			&& EndMs >= StartMs
			&& Confidence >= 0.0f;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechTranscriptResult
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SessionId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UtteranceId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LanguageCode = TEXT("en");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TaskKind = TEXT("transcribe");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString GrammarProfileId = TEXT("coach-command-grammar-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bIsFinal = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString TranscriptText;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechTranscriptSegment> Segments;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> Warnings;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OrchestrationProfileId = TEXT("python-batch-transcribe-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceLaneId = TEXT("speech/python-service");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RequestedBatchSize = 1;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ProcessedClipCount = 1;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 AppliedBatchCollectionWindowMs = 150;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUsedBatchedInference = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bWordTimestampsRequested = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bConditionedOnPreviousText = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUsedPromptHints = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUsedRetrievedHintAugmentation = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float LanguageProbability = 0.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AppliedPromptRoutingModeId = TEXT("prefix-hotword-session-hints-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AppliedPrefixHint;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> AppliedHotwordHints;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AppliedRetrievalContextLaneId = TEXT("speech-command-hint-session-memory");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 RetrievedHintCount = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> AppliedRetrievedHints;

	bool IsStructurallyValid() const
	{
		if (SessionId.IsEmpty()
			|| UtteranceId.IsEmpty()
			|| TaskKind.IsEmpty()
			|| (TranscriptText.IsEmpty() && Segments.Num() <= 0)
			|| OrchestrationProfileId.IsEmpty()
			|| ServiceLaneId.IsEmpty()
			|| RequestedBatchSize <= 0
			|| ProcessedClipCount <= 0
			|| AppliedBatchCollectionWindowMs <= 0
			|| LanguageProbability < 0.0f)
		{
			return false;
		}

		if (AppliedPromptRoutingModeId.IsEmpty() || AppliedRetrievalContextLaneId.IsEmpty())
		{
			return false;
		}

		if (RetrievedHintCount < 0)
		{
			return false;
		}

		if (bUsedRetrievedHintAugmentation && RetrievedHintCount <= 0)
		{
			return false;
		}

		if (RetrievedHintCount != AppliedRetrievedHints.Num())
		{
			return false;
		}

		for (const FHyperTwistSpeechTranscriptSegment& Segment : Segments)
		{
			if (!Segment.IsStructurallyValid())
			{
				return false;
			}
		}

		for (const FString& RetrievedHint : AppliedRetrievedHints)
		{
			if (RetrievedHint.IsEmpty())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistSpeechServiceHealth
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderLabel = TEXT("mock");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceVersion = TEXT("mock-speech/v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceEndpoint;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> Capabilities;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> SupportedOrchestrationProfiles;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderProfileId = TEXT("speech-provider/local-http-sidecar-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechProviderProfile ProviderProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ByokCustodyProfileId = TEXT("speech-byok-custody-profile-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechByokCustodyProfile ByokCustodyProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderRoutingPolicyId = TEXT("speech-provider-routing/provider-backed-sidecar-first-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechProviderRoutingPolicy ProviderRoutingPolicyDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechProviderRouteDecision ProviderRouteDecision;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString UsageCostAccountingProfileId = TEXT("speech-usage-cost-accounting-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechUsageCostAccountingProfile UsageCostAccountingProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechNormalizedUsageEvent LatestUsageEvent;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechNormalizedCostEvent LatestCostEvent;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechQuotaRateLimitState QuotaRateLimitState;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PayloadCustodyProfileId = TEXT("downloadable-model-payload-custody-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistSpeechPayloadCustodyProfile PayloadCustodyProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> SupportedModelPayloadIds;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistSpeechModelPayloadDescriptor> SupportedModelPayloads;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LastError;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bReady = true;

	bool IsStructurallyValid() const
	{
		if (ProviderLabel.IsEmpty()
			|| ServiceVersion.IsEmpty()
			|| ProviderProfileId.IsEmpty()
			|| !ProviderProfileDefinition.IsStructurallyValid()
			|| ByokCustodyProfileId.IsEmpty()
			|| !ByokCustodyProfileDefinition.IsStructurallyValid()
			|| ProviderRoutingPolicyId.IsEmpty()
			|| !ProviderRoutingPolicyDefinition.IsStructurallyValid()
			|| !ProviderRouteDecision.IsStructurallyValid()
			|| UsageCostAccountingProfileId.IsEmpty()
			|| !UsageCostAccountingProfileDefinition.IsStructurallyValid()
			|| !LatestUsageEvent.IsStructurallyValid()
			|| !LatestCostEvent.IsStructurallyValid()
			|| !QuotaRateLimitState.IsStructurallyValid()
			|| PayloadCustodyProfileId.IsEmpty()
			|| !PayloadCustodyProfileDefinition.IsStructurallyValid())
		{
			return false;
		}

		for (const FString& PayloadId : SupportedModelPayloadIds)
		{
			if (PayloadId.IsEmpty())
			{
				return false;
			}
		}

		for (const FHyperTwistSpeechModelPayloadDescriptor& Payload : SupportedModelPayloads)
		{
			if (!Payload.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVoiceAssetDescriptor
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VoiceAssetId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VoiceProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ArtifactName;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RelativePathHint;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SourceDocumentPath;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReviewDocumentPath;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AcquisitionMode = TEXT("user-supplied-or-sidecar-managed");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReviewPosture = TEXT("per-voice-card-review-required");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ApproximateSizeMiB = 64;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bOptionalForPacket = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUserSuppliedOnly = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bBundledWithCodeDistribution = false;

	bool IsStructurallyValid() const
	{
		return !VoiceAssetId.IsEmpty()
			&& !VoiceProfileId.IsEmpty()
			&& !ArtifactName.IsEmpty()
			&& !RelativePathHint.IsEmpty()
			&& !SourceDocumentPath.IsEmpty()
			&& !ReviewDocumentPath.IsEmpty()
			&& !AcquisitionMode.IsEmpty()
			&& !ReviewPosture.IsEmpty()
			&& ApproximateSizeMiB > 0;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVoiceAssetReviewProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VoiceAssetReviewProfileId = TEXT("downloadable-voice-asset-review-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VoiceAssetReviewPosture = TEXT("independent-voice-asset-review-required");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ShippingPosture = TEXT("not-shipped-in-packet");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DownloadWorkflowPosture = TEXT("deferred-out-of-packet");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProvisioningPosture = TEXT("user-supplied-or-sidecar-managed");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CodeLicenseBoundary = TEXT("code-license-reviewed-separately");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresIndependentVoiceAssetReview = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowsBundledVoiceAssetRedistribution = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowsRuntimeVoiceDownloadInCurrentPacket = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsUserManagedVoiceAssets = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsSidecarManagedVoiceAssets = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresPerVoiceModelCardReview = true;

	bool IsStructurallyValid() const
	{
		return !VoiceAssetReviewProfileId.IsEmpty()
			&& !VoiceAssetReviewPosture.IsEmpty()
			&& !ShippingPosture.IsEmpty()
			&& !DownloadWorkflowPosture.IsEmpty()
			&& !ProvisioningPosture.IsEmpty()
			&& !CodeLicenseBoundary.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVoiceModelReviewDescriptor
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VoiceModelReviewId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ModelBindingId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VocoderBindingId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VoiceProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RegistryReferencePath;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReviewDocumentPath;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ModelLicensePosture = TEXT("mixed-per-model-license-selection-required");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString PayloadLicensePosture = TEXT("mixed-payload-license-review-required");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AcquisitionMode = TEXT("downloadable-provider-or-user-supplied");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bTosAcceptanceRequired = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bOptionalForPacket = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bBundledWithCodeDistribution = false;

	bool IsStructurallyValid() const
	{
		return !VoiceModelReviewId.IsEmpty()
			&& !ModelBindingId.IsEmpty()
			&& !VocoderBindingId.IsEmpty()
			&& !VoiceProfileId.IsEmpty()
			&& !RegistryReferencePath.IsEmpty()
			&& !ReviewDocumentPath.IsEmpty()
			&& !ModelLicensePosture.IsEmpty()
			&& !PayloadLicensePosture.IsEmpty()
			&& !AcquisitionMode.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVoiceModelReviewProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VoiceModelReviewProfileId = TEXT("downloadable-voice-model-review-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReviewPosture = TEXT("independent-model-and-payload-review-required");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ShippingPosture = TEXT("not-shipped-in-packet");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DownloadWorkflowPosture = TEXT("deferred-out-of-packet");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString CodeLicenseBoundary = TEXT("code-license-reviewed-separately");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresIndependentModelLicenseReview = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresIndependentPayloadLicenseReview = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bRequiresTermsAcceptanceReview = true;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowsBundledModelRedistribution = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bAllowsRuntimeModelDownloadInCurrentPacket = false;

	bool IsStructurallyValid() const
	{
		return !VoiceModelReviewProfileId.IsEmpty()
			&& !ReviewPosture.IsEmpty()
			&& !ShippingPosture.IsEmpty()
			&& !DownloadWorkflowPosture.IsEmpty()
			&& !CodeLicenseBoundary.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVoiceProfileSummary
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VoiceProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VoiceName;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LanguageCode = TEXT("en_US");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LanguageFamily = TEXT("en");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RegionCode = TEXT("US");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LanguageNameEnglish = TEXT("English");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString Quality = TEXT("medium");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 NumSpeakers = 1;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ModelCardRelativePath;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> Aliases;

	bool IsStructurallyValid() const
	{
		return !VoiceProfileId.IsEmpty()
			&& !VoiceName.IsEmpty()
			&& !LanguageCode.IsEmpty()
			&& !LanguageFamily.IsEmpty()
			&& !RegionCode.IsEmpty()
			&& !LanguageNameEnglish.IsEmpty()
			&& !Quality.IsEmpty()
			&& NumSpeakers > 0;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVoiceProfileCatalog
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVoiceProfileSummary> Profiles;

	bool IsStructurallyValid() const
	{
		if (Profiles.Num() <= 0)
		{
			return false;
		}

		for (const FHyperTwistVoiceProfileSummary& Profile : Profiles)
		{
			if (!Profile.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistNarrationOrchestrationProfile
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OrchestrationProfileId = TEXT("local-basic-narration-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceLaneId = TEXT("voice/local-sidecar");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ModelBindingId = TEXT("voice-model/local-offline-medium-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VocoderBindingId = TEXT("vocoder/default-mono-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString DefaultSpeakerProfileId = TEXT("speaker/default");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEnableSpeakerSelection = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEnableLanguageRouting = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEnableSentenceSplitting = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bEnableSpeakerReferenceConditioning = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsMultiSpeaker = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSupportsMultiLingual = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreferGpu = false;

	bool IsStructurallyValid() const
	{
		return !OrchestrationProfileId.IsEmpty()
			&& !ServiceLaneId.IsEmpty()
			&& !ModelBindingId.IsEmpty()
			&& !VocoderBindingId.IsEmpty()
			&& !DefaultSpeakerProfileId.IsEmpty();
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistNarrationSynthesisRequest
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RequestId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString NarrationContractId = TEXT("embodied-companion-narration");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceLaneId = TEXT("voice/local-sidecar");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OutputRouteId = TEXT("companion/narration/local");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VoiceProfileId = TEXT("en_US-lessac-medium");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LanguageCode = TEXT("en_US");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistNarrationOrchestrationProfile OrchestrationProfile;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ScriptText;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SubtitleSeedText;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 SpeakerId = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SpeakerProfileId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ReferenceVoiceSampleRef;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float LengthScale = 1.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float NoiseScale = 0.667f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float NoiseW = 0.8f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float SentenceSilenceSeconds = 0.2f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bSplitSentences = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bPreferCuda = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AudioEncodingHint = TEXT("wav-pcm16-mono");

	bool IsStructurallyValid() const
	{
		return !RequestId.IsEmpty()
			&& !NarrationContractId.IsEmpty()
			&& !ServiceLaneId.IsEmpty()
			&& !OutputRouteId.IsEmpty()
			&& !VoiceProfileId.IsEmpty()
			&& !LanguageCode.IsEmpty()
			&& OrchestrationProfile.IsStructurallyValid()
			&& ServiceLaneId.Equals(OrchestrationProfile.ServiceLaneId, ESearchCase::CaseSensitive)
			&& !ScriptText.IsEmpty()
			&& !AudioEncodingHint.IsEmpty()
			&& LengthScale > 0.0f
			&& NoiseScale >= 0.0f
			&& NoiseW >= 0.0f
			&& SentenceSilenceSeconds >= 0.0f;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistNarrationSynthesisResult
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString RequestId;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString NarrationContractId = TEXT("embodied-companion-narration");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceLaneId = TEXT("voice/local-sidecar");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OutputRouteId = TEXT("companion/narration/local");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VoiceProfileId = TEXT("en_US-lessac-medium");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LanguageCode = TEXT("en_US");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString OrchestrationProfileId = TEXT("local-basic-narration-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ModelBindingId = TEXT("voice-model/local-offline-medium-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VocoderBindingId = TEXT("vocoder/default-mono-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SpeakerProfileId = TEXT("speaker/default");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString SubtitleText;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString AudioEncoding = TEXT("wav-pcm16-mono");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 SampleRateHz = 16000;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 ChannelCount = 1;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	int32 DurationMs = 0;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float AppliedLengthScale = 1.0f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float AppliedNoiseScale = 0.667f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float AppliedNoiseW = 0.8f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	float AppliedSentenceSilenceSeconds = 0.2f;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUsedSentenceSplitting = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUsedSpeakerSelection = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bUsedSpeakerReferenceConditioning = false;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<uint8> AudioBytes;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> Warnings;

	bool IsStructurallyValid() const
	{
		return !RequestId.IsEmpty()
			&& !NarrationContractId.IsEmpty()
			&& !ServiceLaneId.IsEmpty()
			&& !OutputRouteId.IsEmpty()
			&& !VoiceProfileId.IsEmpty()
			&& !LanguageCode.IsEmpty()
			&& !OrchestrationProfileId.IsEmpty()
			&& !ModelBindingId.IsEmpty()
			&& !VocoderBindingId.IsEmpty()
			&& !SubtitleText.IsEmpty()
			&& !AudioEncoding.IsEmpty()
			&& SampleRateHz > 0
			&& ChannelCount > 0
			&& DurationMs >= 0
			&& AudioBytes.Num() > 0
			&& AppliedLengthScale > 0.0f
			&& AppliedNoiseScale >= 0.0f
			&& AppliedNoiseW >= 0.0f
			&& AppliedSentenceSilenceSeconds >= 0.0f;
	}
};

USTRUCT(BlueprintType)
struct FHyperTwistVoiceServiceHealth
{
	GENERATED_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ProviderLabel = TEXT("mock");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceVersion = TEXT("mock-voice/v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString ServiceEndpoint;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> Capabilities;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> SupportedVoiceProfileIds;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VoiceAssetReviewProfileId = TEXT("downloadable-voice-asset-review-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVoiceAssetReviewProfile VoiceAssetReviewProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> SupportedVoiceAssetIds;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVoiceAssetDescriptor> SupportedVoiceAssets;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString VoiceModelReviewProfileId = TEXT("downloadable-voice-model-review-v1");

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FHyperTwistVoiceModelReviewProfile VoiceModelReviewProfileDefinition;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> SupportedVoiceModelReviewIds;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FHyperTwistVoiceModelReviewDescriptor> SupportedVoiceModelReviews;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> SupportedOrchestrationProfiles;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> SupportedModelBindingIds;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	TArray<FString> SupportedVocoderBindingIds;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	FString LastError;

	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HyperTwist")
	bool bReady = true;

	bool IsStructurallyValid() const
	{
		if (ProviderLabel.IsEmpty() || ServiceVersion.IsEmpty())
		{
			return false;
		}

		if (!VoiceAssetReviewProfileId.IsEmpty()
			|| VoiceAssetReviewProfileDefinition.IsStructurallyValid()
			|| SupportedVoiceAssetIds.Num() > 0
			|| SupportedVoiceAssets.Num() > 0)
		{
			if (VoiceAssetReviewProfileId.IsEmpty()
				|| !VoiceAssetReviewProfileDefinition.IsStructurallyValid()
				|| SupportedVoiceAssetIds.Num() != SupportedVoiceAssets.Num())
			{
				return false;
			}
		}

		for (const FString& VoiceAssetId : SupportedVoiceAssetIds)
		{
			if (VoiceAssetId.IsEmpty())
			{
				return false;
			}
		}

		for (const FHyperTwistVoiceAssetDescriptor& VoiceAsset : SupportedVoiceAssets)
		{
			if (!VoiceAsset.IsStructurallyValid())
			{
				return false;
			}
		}

		if (!VoiceModelReviewProfileId.IsEmpty()
			|| VoiceModelReviewProfileDefinition.IsStructurallyValid()
			|| SupportedVoiceModelReviewIds.Num() > 0
			|| SupportedVoiceModelReviews.Num() > 0)
		{
			if (VoiceModelReviewProfileId.IsEmpty()
				|| !VoiceModelReviewProfileDefinition.IsStructurallyValid()
				|| SupportedVoiceModelReviewIds.Num() != SupportedVoiceModelReviews.Num())
			{
				return false;
			}
		}

		for (const FString& ReviewId : SupportedVoiceModelReviewIds)
		{
			if (ReviewId.IsEmpty())
			{
				return false;
			}
		}

		for (const FHyperTwistVoiceModelReviewDescriptor& Review : SupportedVoiceModelReviews)
		{
			if (!Review.IsStructurallyValid())
			{
				return false;
			}
		}

		return true;
	}
};
