macos: use control channel for health and heartbeat

This commit is contained in:
Peter Steinberger
2025-12-08 21:50:51 +01:00
parent 22996854f7
commit 293b4960f3
5 changed files with 350 additions and 56 deletions

View File

@@ -6,6 +6,7 @@ import MenuBarExtraAccess
import OSLog
import Security
import SwiftUI
import Network
@main
struct ClawdisApp: App {
@@ -661,6 +662,10 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSXPCListenerDelegate
RelayProcessManager.shared.setActive(!state.isPaused)
}
Task {
let controlMode: ControlChannel.Mode = AppStateStore.shared.connectionMode == .remote
? .remote(target: AppStateStore.shared.remoteTarget, identity: AppStateStore.shared.remoteIdentity)
: .local
try? await ControlChannel.shared.configure(mode: controlMode)
try? await AgentRPC.shared.start()
_ = await AgentRPC.shared.setHeartbeatsEnabled(AppStateStore.shared.heartbeatsEnabled)
}