namespace Titano.Protocol; public sealed record JobDto( Guid Id, string Kind, IReadOnlyList TargetIds, string? TargetLabel, string State, string Priority, long ProgressDone, long ProgressTotal, double? ItemsPerSecond, double? EtaSeconds, string? LogTail, string? NodeId, int Attempts, string? Error, DateTimeOffset Created, DateTimeOffset? Started, DateTimeOffset? Finished); /// POST /api/v1/jobs: kind = render, deep-analyse, proxies, thumbs, verify, scan, rebuild, maintenance… public sealed record CreateJobRequest(string Kind, IReadOnlyList Target, string? ParametersJson); /// /// POST /api/v1/nodes/register: a client offers its GPU encoders (BRIEF §14.7). × /// is the largest output of any of them, for encoders that announce no limit of their own. /// public sealed record RegisterNodeRequest(string ClientName, IReadOnlyList Encoders, int MaxWidth, int MaxHeight); /// /// One encoder of a render node. × is its largest output (0 = not announced: /// the node's own limit applies), so jobs go only to a node with an encoder of their codec that takes their size. /// public sealed record NodeEncoder(string Codec, string Name, bool Hardware, bool TenBit, int MaxWidth = 0, int MaxHeight = 0); public sealed record RenderNodeDto(Guid Id, string ClientName, string Username, IReadOnlyList Encoders, DateTimeOffset LastHeartbeat, string State); /// POST /api/v1/nodes/{id}/claim: the job and everything needed to run it, or 204 when none matches. public sealed record ClaimedJob(JobDto Job, Guid SequenceId, string SettingsJson, string PresetJson, bool UseProxies, IReadOnlyList Frames); /// POST /api/v1/nodes/{id}/jobs/{jobId}/progress. public sealed record NodeProgress(long Done, long Total, double? ItemsPerSecond, string? LogLine); /// POST /api/v1/jobs/{id}/priority: background, normal or user. public sealed record JobPriorityRequest(string Priority); /// /// parametersJson of a render job: what to encode. Render nodes claim the job when they have an encoder for /// at × (BRIEF §14.7). /// public sealed record RenderJobParameters(string PresetName, string PresetJson, string Codec, int Width, int Height, bool UseProxies, string? SettingsJson); /// POST /api/v1/nodes/{id}/jobs/{jobId}/result: the finished output a node is about to upload in chunks. public sealed record RenderResultRequest( string FileName, long Size, string Sha256, string PresetName, string? Codec, int Width, int Height, double Fps, double DurationSeconds); /// POST /api/v1/nodes/{id}/jobs/{jobId}/failed: the node could not render the job. public sealed record NodeJobFailure(string Error);