import Foundation
import WireProtocol

/// A paired web-terminal host (frozen contract, plan §3.3). Immutable
/// snapshot: identity (`id`) and dial info (`endpoint`) are fixed at creation;
/// "renaming" a host means upserting a new value with the same `id`.
///
/// Note: on macOS this shadows `Foundation.Host` (NSHost) inside this module;
/// downstream test/app targets that import Foundation should alias
/// `typealias Host = HostRegistry.Host` or qualify.
public struct Host: Sendable, Equatable, Codable, Identifiable {
    public let id: UUID
    public let name: String
    /// Single point of Origin/wsURL derivation — from WireProtocol, never
    /// redeclared here (plan §6 rule 1).
    public let endpoint: HostEndpoint

    public init(id: UUID, name: String, endpoint: HostEndpoint) {
        self.id = id
        self.name = name
        self.endpoint = endpoint
    }
}
