// Provenance: own design — shared run scripts
namespace Godosa.Core.Runs.Scripts;
public enum BlockKind { Setup, Step, Try }
/// One parsed line (or block header) of a .steps file; = the trimmed source line.
public abstract record Node(SourceRef At, string Text);
public sealed record VerbNode(SourceRef At, string Text, string Verb, string Args) : Node(At, Text);
public sealed record WaitNode(SourceRef At, string Text, string Condition, int Timeout) : Node(At, Text);
public sealed record ExpectNode(SourceRef At, string Text, string Condition) : Node(At, Text);
public sealed record SetNode(SourceRef At, string Text, string Name, string Value) : Node(At, Text);
public sealed record IncludeNode(SourceRef At, string Text, string Path) : Node(At, Text);
public sealed record CallNode(SourceRef At, string Text, string Name, IReadOnlyList Args) : Node(At, Text);
public sealed record CheckpointNode(SourceRef At, string Text, string Name) : Node(At, Text);
public sealed record BlockNode(SourceRef At, string Text, BlockKind Kind, string? Label, IReadOnlyList Body) : Node(At, Text);
public sealed record DefNode(SourceRef At, string Text, string Name, IReadOnlyList Params, IReadOnlyList Body) : Node(At, Text);
public sealed record ScriptFile(string Path, int Format, RunMode? Mode, ulong? Seed, IReadOnlyList VarFiles,
IReadOnlyList Body, IReadOnlyList Errors);
public static class ScriptFormat
{
/// Newest format version this runner knows; every older one stays supported.
public const int Latest = 1;
}