feat(macos): add instances tab and presence beacons

This commit is contained in:
Peter Steinberger
2025-12-09 02:25:45 +01:00
parent 1969e78d54
commit bc92f6d4a4
6 changed files with 274 additions and 4 deletions

View File

@@ -253,7 +253,13 @@ final class ControlChannel: ObservableObject {
return try? JSONDecoder().decode(ControlHeartbeatEvent.self, from: data)
}
private func request(method: String, params: [String: Any]? = nil, timeout: TimeInterval? = nil) async throws -> Data {
func sendSystemEvent(_ text: String) async throws {
let trimmed = text.trimmingCharacters(in: .whitespacesAndNewlines)
guard !trimmed.isEmpty else { return }
_ = try await self.request(method: "system-event", params: ["text": trimmed], timeout: 5)
}
func request(method: String, params: [String: Any]? = nil, timeout: TimeInterval? = nil) async throws -> Data {
try await self.ensureConnected()
let id = UUID().uuidString
var frame: [String: Any] = ["type": "request", "id": id, "method": method]