Shaykh Al Mufid(Rh) writes:
Thoughts about the knowledge of the imams (peace be upon him) of inner thoughts of humans and other creatures, and calling them with knowledge of the unseen, and that they those as attributes.
I say: The imams from the progeny of Muhammad (saw) knew the inner thoughts of some slaves (of Allah) and knew what would happen before it came into being
These attributes are not a condition for their imamate, however, God Almighty honored them with it and taught them to as a form of (lutf) reward for their obedience and adherence to their status of imam. These attributes are not necessary from the view point of logic, but obligatory to believe because of narrations.
, As for saying that the Imams know unseen, so it is an extremely evil and corrupt belief because the description of that is only deserved by the one who knows things by Himself, not with learned knowledge, and this is only God- the Almighty - and following my belief a group of Imamites (Shia) except for those who deviate from them from the Mufawidda and Ghulat.
📚Al-Awail Al Maqalat P67