just to clarify, you will probably not find anyone with knowledge of the primary protocols who is willing to provide it to anyone else if you wish to implement primary (those who scream "open source" "release specs" etc the loudest - after finally figuring out the protocol all end up agreeing that it should remain closed)
however the rest of it is all public domain and easily accessible in many forms - a few write ups, anything you're not 100% on just figure it out in the program (ie. get a response, display it and you'll quickly spot what the contents of the packet are) however the documentation for chat and secondary are freely posted in several places, as well as being able to look through source code for bits