       debug 'components-changed', names
       for name in names
         component = allComponents[name]
-        # TODO: let Library emit a new change when discovery message comes in,
-        # which has inPorts/outPorts info etc
-        info =
-          name: name
-          description: component.cmd
-          icon: null
-          subgraph: false
-          inPorts: []
-          outPorts: []
+        info = fbpComponentFromMsgflo name, component
         @transport.sendAll 'component', 'component', info
 
     @coordinator.on 'data', (from, fromPort, to, toPort, data) =>


debug = require('debug')('msgflo:fbp')
EventEmitter = require('events').EventEmitter

handleMessage = (proto, sub, cmd, payload, ctx) ->
  debug 'RECV:', sub, cmd, payload


  # Component
  else if sub == 'component' and cmd == 'list'


    debug 'attempting to list components'
    components = []
    for name, component of proto.coordinator.library.components
      info = fbpComponentFromMsgflo name, component
      components.push info

    for info in components
      proto.transport.send 'component', 'component', info, ctx
    proto.transport.send 'component', 'componentsready', components.length, ctx
    debug 'sent components', components.length

