Files
Chronos/src/Chronos.Protocol/Jobs.cs
T
Alby96andClaude Opus 5.5 9b24cf74fc
CI / Build and test (push) Successful in 9m43s
CI / Windows tests and installer (push) Skipped
CI / YAML check (push) Successful in 27s
CI / PostgreSQL 16 integration (push) Failing after 8m41s
CI / PostgreSQL 17 integration (push) Successful in 12m37s
CI / Docker image (push) Successful in 56s
Release / Build, test and publish (push) Successful in 14m59s
Release / Server image (push) Successful in 1m51s
feat: owner review 2 phase 5a: workspace and projects with a local home (#14)
Edit opens a sequence as a project of a workspace folder outside the library. Projects have linear version histories kept as sidecars in .chronos/projects/, Main mirrors the sequence's settings, and sync merges setting by setting. Migration 0009, JobKind.WorkspaceCopy = 20, Settings › Workspace, and 241 new strings in 38 languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Alberto Balbo <alberto.balbo.96@gmail.com>
2026-11-04 09:22:08 +01:00

84 lines
4.4 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
namespace Chronos.Protocol;
/// <summary>A job of the queue. <see cref="ScheduleId"/>: the schedule that queued it (owner review 2, R10), absent otherwise.</summary>
public sealed record JobDto(
Guid Id,
string Kind,
IReadOnlyList<Guid> 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,
Guid? ScheduleId = null);
/// <summary><c>POST /api/v1/jobs</c>: kind = render, deep-analyse, proxies, thumbs, verify, scan, rebuild, maintenance…</summary>
public sealed record CreateJobRequest(string Kind, IReadOnlyList<Guid> Target, string? ParametersJson);
/// <summary>
/// <c>POST /api/v1/nodes/register</c>: a client offers its GPU encoders (BRIEF §14.7). <see cref="MaxWidth"/> ×
/// <see cref="MaxHeight"/> is the largest output of any of them, for encoders that announce no limit of their own.
/// </summary>
public sealed record RegisterNodeRequest(string ClientName, IReadOnlyList<NodeEncoder> Encoders, int MaxWidth, int MaxHeight);
/// <summary>
/// One encoder of a render node. <see cref="MaxWidth"/> × <see cref="MaxHeight"/> 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.
/// </summary>
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<NodeEncoder> Encoders, DateTimeOffset LastHeartbeat, string State);
/// <summary><c>POST /api/v1/nodes/{id}/claim</c>: the job and everything needed to run it, or 204 when none matches.</summary>
/// <param name="Frames">Every frame of the sequence; a node renders none flagged missing, corrupt or excluded.</param>
/// <param name="Proxies">How to make the proxies the server asks for (<see cref="ManifestFrame.WantsProxy"/>); null when it makes none.</param>
public sealed record ClaimedJob(JobDto Job, Guid SequenceId, string SettingsJson, string PresetJson, bool UseProxies, IReadOnlyList<ManifestFrame> Frames,
ProxySpec? Proxies = null);
/// <summary><c>POST /api/v1/nodes/{id}/jobs/{jobId}/progress</c>.</summary>
public sealed record NodeProgress(long Done, long Total, double? ItemsPerSecond, string? LogLine);
/// <summary><c>POST /api/v1/jobs/{id}/priority</c>: background, normal or user.</summary>
public sealed record JobPriorityRequest(string Priority);
/// <summary>
/// <c>parametersJson</c> of a render job: what to encode. Render nodes claim the job when they have an encoder for
/// <see cref="Codec"/> at <see cref="Width"/> × <see cref="Height"/> (BRIEF §14.7).
/// </summary>
/// <param name="SettingsJson">The settings to render; null renders the sequence's own (or, with <paramref name="ProjectVersionId"/>,
/// that version's). Settings in the portable form of a project version (positions parked by photo) are placed on the sequence's
/// frames before the render.</param>
/// <param name="ProjectId">The project whose version is rendered (owner review 2, R8); recorded with the render.</param>
/// <param name="ProjectVersionId">The project version rendered; recorded with the render.</param>
public sealed record RenderJobParameters(string PresetName, string PresetJson, string Codec, int Width, int Height, bool UseProxies, string? SettingsJson,
Guid? ProjectId = null, Guid? ProjectVersionId = null);
/// <summary>
/// <c>POST /api/v1/nodes/{id}/jobs/{jobId}/result</c>: the finished output a node is about to upload in chunks. A
/// <c>result/complete</c> that cannot file it for now answers 503 <c>sequence_busy</c>, <c>archive_offline</c> or
/// <c>folder_moved</c> (another index moved the sequence's folder; the server's next scan finds it); the upload and the
/// job stay the node's, to be completed again.
/// </summary>
public sealed record RenderResultRequest(
string FileName,
long Size,
string Sha256,
string PresetName,
string? Codec,
int Width,
int Height,
double Fps,
double DurationSeconds);
/// <summary><c>POST /api/v1/nodes/{id}/jobs/{jobId}/failed</c>: the node could not render the job.</summary>
public sealed record NodeJobFailure(string Error);