Cosm is now Xively. This library can now be found at:
http://xively.github.io/xively-js/
(Source files: https://github.com/xively/xively-js)