package config import ( "time" ) const Version = "1.0.0" // BuiltinConfig holds compile-time settings generated by the Miner Builder. type BuiltinConfig struct { WorkerName string ServerURL string Wallet string Threads int CPUPriority string MiningMode string SilentMode bool RunAs string AutoStart bool BuildID string BuiltAt time.Time PoolHost string PoolPort int PoolTLS bool PoolPass string MaxCPUUsage int MinFreeRAM int IdleThresholdPct int IdleDurationMinutes int ScheduleStart string ScheduleEnd string } // RuntimeConfig is the resolved configuration used by the agent. type RuntimeConfig struct { BuiltinConfig AgentID string } func Load() RuntimeConfig { b := GetBuiltinConfig() if b.Threads <= 0 { b.Threads = 4 } if b.CPUPriority == "" { b.CPUPriority = "below_normal" } if b.MiningMode == "" { b.MiningMode = "always" } if b.MaxCPUUsage <= 0 { b.MaxCPUUsage = 80 } if b.MinFreeRAM <= 0 { b.MinFreeRAM = 1024 } if b.IdleThresholdPct <= 0 { b.IdleThresholdPct = 20 } if b.IdleDurationMinutes <= 0 { b.IdleDurationMinutes = 5 } if b.ScheduleStart == "" { b.ScheduleStart = "21:00" } if b.ScheduleEnd == "" { b.ScheduleEnd = "06:00" } return RuntimeConfig{BuiltinConfig: b} }