       auth        :
         type      : 'token'
         key       : token
+
+  createKites: (kiteDescriptors) -> (@createKite k for k in kiteDescriptors)
 
   fetchKites: (query = {}, callback) ->
     @kite.tell 'getKites', [query], (err, result) =>


      callback null, { changes, watcherID }

      changes.emit 'register', kite for kite in @kiteify kiteDescriptors

  cancelWatcher: (id, callback) ->

  createUpdateHandler: (changes) -> (response) =>
    { err, result } = @kite.unwrapMessage response

    if err
      changes.emit 'error', err
      return

    { action, kite, token } = result

    kite = @createKite { kite, token }

    eventName = @constructor.actions[action]
    changes.emit eventName, kite

  kiteify: (kiteDescriptors) -> (@createKite k for k in kiteDescriptors)

  @actions      =
    REGISTER    : 'register'
    DEREGISTER  : 'deregister'

      url   : url
      auth  : { type, key }

  createKite: ({ kite: { name }, token, url }) ->
    new @constructor.Kite
      autoConnect : no
      name        : name
