#pragma once

// Clean-room implementation for HyperTwist algorithm-language subsystem
// Implemented from governance docs only (Phase 0R-D, Phase 1R, Phase 5R-A)
// Date: 2026-05-15
// Model: Claude (Model B, Bound 1 contribution)

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "HyperTwistAlgorithm/HyperTwistAlgorithmTypes.h"
#include "HyperTwistAlgorithmSerializer.generated.h"

UCLASS()
class UNREALHYPERTWIST_API UHyperTwistAlgorithmSerializer : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()

public:
	// Serialize AST to canonical text representation
	UFUNCTION(BlueprintPure, Category = "HyperTwist|Algorithm")
	static FString SerializeAlgorithm(const FHyperTwistAlgorithmSequence& Sequence);

	// Serialize AST to JSON
	UFUNCTION(BlueprintCallable, Category = "HyperTwist|Algorithm")
	static bool TrySerializeToJson(
		const FHyperTwistAlgorithmSequence& Sequence,
		FString& OutJson
	);
};
