mirror of
https://github.com/hanzoai/bot.git
synced 2026-10-30 17:24:26 +00:00
Comprehensive rename of all openclaw references to hanzo-bot equivalents: - Package: openclaw → @hanzo/bot - Binary: openclaw → hanzo-bot - Types: OpenClaw* → Bot* - Env vars: OPENCLAW_* → BOT_* - Android: ai.openclaw.android → ai.hanzo.bot.android - iOS/macOS: ai.openclaw.* → ai.hanzo.* - Swift modules: OpenClaw* → Bot* - Plugins: openclaw.plugin.json → bot.plugin.json - Paths: .openclaw/ → .hanzo/bot/ - URLs: github.com/openclaw → github.com/hanzoai
28 lines
1.0 KiB
Swift
28 lines
1.0 KiB
Swift
import Foundation
|
|
import 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 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
|
|
}
|
|
}
|