detect main/output type in spm package
update hist