mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Automated rebrand of all openclaw references to hanzo bot: - Package: openclaw -> @hanzo/bot - Binary: openclaw -> hanzo-bot - Config: ~/.openclaw -> ~/.hanzo/bot - Docker: ghcr.io/hanzoai/bot - Env vars: OPENCLAW_* -> BOT_* - Bundle IDs: ai.hanzo.bot.* - Product name: Hanzo Bot
29 lines
1.1 KiB
Swift
29 lines
1.1 KiB
Swift
import Foundation
|
|
import Hanzo BotKit
|
|
|
|
/// Single source of truth for "how we connect" to the current gateway.
|
|
///
|
|
/// The iOS app maintains two WebSocket sessions to the same gateway:
|
|
/// - a `role=node` session for device capabilities (`node.invoke.*`)
|
|
/// - a `role=operator` session for chat/talk/config (`chat.*`, `talk.*`, etc.)
|
|
///
|
|
/// Both sessions should derive all connection inputs from this config so we
|
|
/// don't accidentally persist gateway-scoped state under different keys.
|
|
struct GatewayConnectConfig: Sendable {
|
|
let url: URL
|
|
let stableID: String
|
|
let tls: GatewayTLSParams?
|
|
let token: String?
|
|
let bootstrapToken: String?
|
|
let password: String?
|
|
let nodeOptions: GatewayConnectOptions
|
|
|
|
/// Stable, non-empty identifier used for gateway-scoped persistence keys.
|
|
/// If the caller doesn't provide a stableID, fall back to URL identity.
|
|
var effectiveStableID: String {
|
|
let trimmed = self.stableID.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
if trimmed.isEmpty { return self.url.absoluteString }
|
|
return trimmed
|
|
}
|
|
}
|