import Foundation /// Server configuration loaded from environment variables public struct Config: Sendable { /// Host to bind the server to (default: 0.0.0.0 for LAN access) public let host: String /// Port to listen on (default: 50051) public let port: Int /// Optional API key for authentication via gRPC metadata public let apiKey: String? /// Initialize configuration from environment variables public init() { self.host = ProcessInfo.processInfo.environment["GRPC_HOST"] ?? "0.0.0.0" self.port = Int(ProcessInfo.processInfo.environment["GRPC_PORT"] ?? "50051") ?? 50051 self.apiKey = ProcessInfo.processInfo.environment["API_KEY"] } /// Initialize with explicit values (for testing) public init(host: String, port: Int, apiKey: String? = nil) { self.host = host self.port = port self.apiKey = apiKey } }