feat(agent): add screen blackout feature

- Physical displays blanked via overlay
- Remote video and input keep working
- Exclude overlay from screen capture
- Add blackout API and UI toggle
- Wire flag through capture protocol
This commit is contained in:
2026-09-02 13:32:21 +03:00
parent 45f345123d
commit 149fcde379
16 changed files with 557 additions and 28 deletions
+38 -4
View File
@@ -168,10 +168,11 @@ func Spec() map[string]any {
"200": map[string]any{
"description": "Screenshot image",
"headers": map[string]any{
"X-Monitor-Left": map[string]any{"schema": map[string]string{"type": "integer"}},
"X-Monitor-Top": map[string]any{"schema": map[string]string{"type": "integer"}},
"X-Monitor-Width": map[string]any{"schema": map[string]string{"type": "integer"}},
"X-Monitor-Height": map[string]any{"schema": map[string]string{"type": "integer"}},
"X-Monitor-Left": map[string]any{"schema": map[string]string{"type": "integer"}},
"X-Monitor-Top": map[string]any{"schema": map[string]string{"type": "integer"}},
"X-Monitor-Width": map[string]any{"schema": map[string]string{"type": "integer"}},
"X-Monitor-Height": map[string]any{"schema": map[string]string{"type": "integer"}},
"X-Screen-Blackout": map[string]any{"schema": map[string]string{"type": "string"}, "description": "1 when physical monitors are blacked out"},
},
"content": map[string]any{
"image/png": map[string]any{"schema": map[string]string{"type": "string", "format": "binary"}},
@@ -183,6 +184,26 @@ func Spec() map[string]any {
}),
},
},
"/api/v1/blackout": map[string]any{
"get": map[string]any{
"summary": "Read physical monitor blackout",
"operationId": "getBlackout",
"responses": auth(map[string]any{
"200": okJSON("Blackout state", ref("BlackoutState")),
}),
},
"put": map[string]any{
"summary": "Black out physical monitors",
"operationId": "setBlackout",
"description": "Covers physical displays with a click-through overlay excluded from capture. Remote video and input keep working.",
"requestBody": jsonBody(ref("BlackoutUpdate")),
"responses": auth(map[string]any{
"200": okJSON("Blackout state", ref("BlackoutState")),
"400": errResp("Invalid body"),
"503": errResp("Blackout failed"),
}),
},
},
"/api/v1/webcam": map[string]any{
"get": map[string]any{
"summary": "List webcams",
@@ -563,6 +584,19 @@ func Spec() map[string]any {
"klogging": map[string]any{"type": "boolean"},
},
},
"BlackoutState": map[string]any{
"type": "object",
"properties": map[string]any{
"enabled": map[string]any{"type": "boolean"},
},
},
"BlackoutUpdate": map[string]any{
"type": "object",
"required": []string{"enabled"},
"properties": map[string]any{
"enabled": map[string]any{"type": "boolean"},
},
},
"ClickRequest": map[string]any{
"type": "object", "required": []string{"x", "y", "button"},
"properties": map[string]any{