Files
Chronos/src/Titano.Protocol/Events.cs
T
Claude 83d8cd79bd feat(protocol): API v1 contract and typed client
DTOs for auth, users, sequences, frames, manifests, uploads, jobs,
render nodes, events and LAN discovery; TitanoClient with TOFU
certificate pinning, bearer auth, resumable SHA-256-verified chunked
uploads with retry/backoff, shared bandwidth limiter and the event
WebSocket stream.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-02 09:41:20 +00:00

23 lines
1.0 KiB
C#

using System.Text.Json.Serialization;
namespace Titano.Protocol;
/// <summary>
/// Messages pushed on <c>WS /api/v1/events</c>. Each frame is one JSON object with a <c>type</c> discriminator:
/// jobProgress, jobState, sequenceChanged, cardEvent, nodeState.
/// </summary>
[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
[JsonDerivedType(typeof(JobProgressEvent), "jobProgress")]
[JsonDerivedType(typeof(JobStateEvent), "jobState")]
[JsonDerivedType(typeof(SequenceChangedEvent), "sequenceChanged")]
[JsonDerivedType(typeof(NodeStateEvent), "nodeState")]
public abstract record ServerEvent;
public sealed record JobProgressEvent(Guid JobId, long Done, long Total, double? ItemsPerSecond, double? EtaSeconds) : ServerEvent;
public sealed record JobStateEvent(Guid JobId, string State, string? Error) : ServerEvent;
public sealed record SequenceChangedEvent(Guid SequenceId, string Change, int FramesVersion, int SettingsVersion) : ServerEvent;
public sealed record NodeStateEvent(Guid NodeId, string ClientName, string State) : ServerEvent;