nbp-skills-cluster

0.0.2 • Public • Published

Skills Cluster

This is a Skills Cluster for Node.js Bot Platform. Abilities of this Cluster:

  • plug different Skills;
  • build part of decision tree (a queue) of skills;
  • run traverse.

Skill

You can define a skill as an object with name and lambda fields:

const skill = {
    name: 'skillName',
    lambda: function(context) {
        return Promise.resolve(context);
    }
};

Skill always should return a Promise, which resolve a context. Context is usually consist of services, that current bot used, and rules:

const skillLambda = function({ bot, rules }) {
   // The list of services is dependent on route-builder.js in Node.js Bot Platform repository 
   // bot.storage
   // bot.memcached
   // bot.messenger
   return Promise.resolve({ bot, rules });
}

Please, look at usage example.

Readme

Keywords

none

Package Sidebar

Install

npm i nbp-skills-cluster

Weekly Downloads

0

Version

0.0.2

License

ISC

Last publish

Collaborators

  • maxmert