Add C# bridges and coordinator service
- geviscope-bridge: GeViScope SDK REST wrapper (:7720) - gcore-bridge: G-Core SDK REST wrapper (:7721) - geviserver-bridge: GeViServer REST wrapper (:7710) - copilot-coordinator: WebSocket coordination hub (:8090) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
36
copilot-coordinator/Models/CameraLock.cs
Normal file
36
copilot-coordinator/Models/CameraLock.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
namespace CopilotCoordinator.Models;
|
||||
|
||||
public record CameraLock(
|
||||
int CameraId,
|
||||
CameraLockPriority Priority,
|
||||
string OwnerName,
|
||||
DateTime OwnedSince,
|
||||
DateTime ExpiresAt
|
||||
);
|
||||
|
||||
public enum CameraLockPriority { None, High, Low }
|
||||
|
||||
public enum CameraLockNotificationType
|
||||
{
|
||||
Acquired,
|
||||
TakenOver,
|
||||
ConfirmTakeOver,
|
||||
Confirmed,
|
||||
Rejected,
|
||||
ExpireSoon,
|
||||
Unlocked
|
||||
}
|
||||
|
||||
public record CameraLockResult(bool Acquired, CameraLock? Lock);
|
||||
|
||||
public record CameraLockNotification(
|
||||
CameraLockNotificationType Type,
|
||||
int CameraId,
|
||||
string CopilotName
|
||||
);
|
||||
|
||||
public record LockRequest(int CameraId, string KeyboardId, string Priority = "low");
|
||||
public record UnlockRequest(int CameraId, string KeyboardId);
|
||||
public record TakeoverRequest(int CameraId, string KeyboardId, string Priority = "low");
|
||||
public record TakeoverConfirmRequest(int CameraId, string KeyboardId, bool Confirm);
|
||||
public record ResetExpirationRequest(int CameraId, string KeyboardId);
|
||||
24
copilot-coordinator/Models/Messages.cs
Normal file
24
copilot-coordinator/Models/Messages.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace CopilotCoordinator.Models;
|
||||
|
||||
/// <summary>
|
||||
/// WebSocket message envelope for all coordinator events.
|
||||
/// </summary>
|
||||
public class WsMessage
|
||||
{
|
||||
[JsonPropertyName("type")]
|
||||
public string Type { get; set; } = "";
|
||||
|
||||
[JsonPropertyName("data")]
|
||||
public JsonElement? Data { get; set; }
|
||||
|
||||
public static string Serialize(string type, object? data = null)
|
||||
{
|
||||
var msg = new { type, data };
|
||||
return JsonSerializer.Serialize(msg);
|
||||
}
|
||||
}
|
||||
|
||||
public record KeyboardInfo(string Id, string? Name, DateTime ConnectedAt);
|
||||
21
copilot-coordinator/Models/Sequence.cs
Normal file
21
copilot-coordinator/Models/Sequence.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
namespace CopilotCoordinator.Models;
|
||||
|
||||
public record SequenceDefinition(
|
||||
int Id,
|
||||
string Name,
|
||||
int CategoryId,
|
||||
List<int> Cameras,
|
||||
int IntervalSeconds
|
||||
);
|
||||
|
||||
public record SequenceCategory(int Id, string Name);
|
||||
|
||||
public record RunningSequence(
|
||||
int ViewerId,
|
||||
int SequenceId,
|
||||
DateTime StartedAt,
|
||||
int CurrentCameraIndex
|
||||
);
|
||||
|
||||
public record SequenceStartRequest(int ViewerId, int SequenceId);
|
||||
public record SequenceStopRequest(int ViewerId);
|
||||
Reference in New Issue
Block a user