refactor: remove bridge protocol
This commit is contained in:
@@ -2,24 +2,24 @@ import Foundation
|
||||
|
||||
public enum ClawdbotBonjour {
|
||||
// v0: internal-only, subject to rename.
|
||||
public static let bridgeServiceType = "_clawdbot-bridge._tcp"
|
||||
public static let bridgeServiceDomain = "local."
|
||||
public static let wideAreaBridgeServiceDomain = "clawdbot.internal."
|
||||
public static let gatewayServiceType = "_clawdbot-gateway._tcp"
|
||||
public static let gatewayServiceDomain = "local."
|
||||
public static let wideAreaGatewayServiceDomain = "clawdbot.internal."
|
||||
|
||||
public static let bridgeServiceDomains = [
|
||||
bridgeServiceDomain,
|
||||
wideAreaBridgeServiceDomain,
|
||||
public static let gatewayServiceDomains = [
|
||||
gatewayServiceDomain,
|
||||
wideAreaGatewayServiceDomain,
|
||||
]
|
||||
|
||||
public static func normalizeServiceDomain(_ raw: String?) -> String {
|
||||
let trimmed = (raw ?? "").trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
if trimmed.isEmpty {
|
||||
return self.bridgeServiceDomain
|
||||
return self.gatewayServiceDomain
|
||||
}
|
||||
|
||||
let lower = trimmed.lowercased()
|
||||
if lower == "local" || lower == "local." {
|
||||
return self.bridgeServiceDomain
|
||||
return self.gatewayServiceDomain
|
||||
}
|
||||
|
||||
return lower.hasSuffix(".") ? lower : (lower + ".")
|
||||
|
||||
@@ -29,6 +29,7 @@ public struct ClawdbotSystemRunParams: Codable, Sendable, Equatable {
|
||||
public var needsScreenRecording: Bool?
|
||||
public var agentId: String?
|
||||
public var sessionKey: String?
|
||||
public var approved: Bool?
|
||||
|
||||
public init(
|
||||
command: [String],
|
||||
@@ -38,7 +39,8 @@ public struct ClawdbotSystemRunParams: Codable, Sendable, Equatable {
|
||||
timeoutMs: Int? = nil,
|
||||
needsScreenRecording: Bool? = nil,
|
||||
agentId: String? = nil,
|
||||
sessionKey: String? = nil)
|
||||
sessionKey: String? = nil,
|
||||
approved: Bool? = nil)
|
||||
{
|
||||
self.command = command
|
||||
self.rawCommand = rawCommand
|
||||
@@ -48,6 +50,7 @@ public struct ClawdbotSystemRunParams: Codable, Sendable, Equatable {
|
||||
self.needsScreenRecording = needsScreenRecording
|
||||
self.agentId = agentId
|
||||
self.sessionKey = sessionKey
|
||||
self.approved = approved
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user