chore(mac): include os version and locale in handshake
parent
5a8d18edf3
commit
5e4f32d808
|
|
@ -57,6 +57,10 @@ private actor GatewayChannelActor {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func sendHello() async throws {
|
private func sendHello() async throws {
|
||||||
|
let osVersion = ProcessInfo.processInfo.operatingSystemVersion
|
||||||
|
let platform = "macos \(osVersion.majorVersion).\(osVersion.minorVersion).\(osVersion.patchVersion)"
|
||||||
|
let primaryLocale = Locale.preferredLanguages.first ?? Locale.current.identifier
|
||||||
|
|
||||||
let hello = Hello(
|
let hello = Hello(
|
||||||
type: "hello",
|
type: "hello",
|
||||||
minprotocol: GATEWAY_PROTOCOL_VERSION,
|
minprotocol: GATEWAY_PROTOCOL_VERSION,
|
||||||
|
|
@ -64,14 +68,14 @@ private actor GatewayChannelActor {
|
||||||
client: [
|
client: [
|
||||||
"name": ClawdisProtocol.AnyCodable("clawdis-mac"),
|
"name": ClawdisProtocol.AnyCodable("clawdis-mac"),
|
||||||
"version": ClawdisProtocol.AnyCodable(Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "dev"),
|
"version": ClawdisProtocol.AnyCodable(Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "dev"),
|
||||||
"platform": ClawdisProtocol.AnyCodable("macos"),
|
"platform": ClawdisProtocol.AnyCodable(platform),
|
||||||
"mode": ClawdisProtocol.AnyCodable("app"),
|
"mode": ClawdisProtocol.AnyCodable("app"),
|
||||||
"instanceId": ClawdisProtocol.AnyCodable(Host.current().localizedName ?? UUID().uuidString),
|
"instanceId": ClawdisProtocol.AnyCodable(Host.current().localizedName ?? UUID().uuidString),
|
||||||
],
|
],
|
||||||
caps: [],
|
caps: [],
|
||||||
auth: self.token.map { ["token": ClawdisProtocol.AnyCodable($0)] },
|
auth: self.token.map { ["token": ClawdisProtocol.AnyCodable($0)] },
|
||||||
locale: nil,
|
locale: primaryLocale,
|
||||||
useragent: nil)
|
useragent: ProcessInfo.processInfo.operatingSystemVersionString)
|
||||||
let data = try JSONEncoder().encode(hello)
|
let data = try JSONEncoder().encode(hello)
|
||||||
try await self.task?.send(.data(data))
|
try await self.task?.send(.data(data))
|
||||||
guard let msg = try await task?.receive() else {
|
guard let msg = try await task?.receive() else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue