@indra.ai/deva 1.1.7 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,6 +39,9 @@ const HelloWorld = new Deva({
39
39
  listeners: {
40
40
  '101:state'(st) {
41
41
  console.log(`current state: ${st}`);
42
+ },
43
+ 'log'(packet) {
44
+ console.log('logger', packet);
42
45
  }
43
46
  },
44
47
  deva: {},
package/index.js CHANGED
@@ -17,6 +17,8 @@ class Deva {
17
17
  enter: 'ENTER',
18
18
  exit: 'EXIT',
19
19
  done: 'DONE',
20
+ load: 'LOAD DEVAS',
21
+ unload: 'UNLOAD DEVAS',
20
22
  wait: 'WAITING',
21
23
  data: 'DATA',
22
24
  ask: 'ASK',
@@ -59,6 +61,7 @@ class Deva {
59
61
  this.bind = ["listeners", "methods", "func", "lib", "security", "agent", "client"];
60
62
  this.messages = {
61
63
  offline: 'AGENT OFFLINE',
64
+ loading: 'DEVAS LOADING',
62
65
  loaded: 'DEVAS LOADED',
63
66
  stopped: 'DEVAS STOPPED',
64
67
  notext: 'NO TEXT',
@@ -487,7 +490,6 @@ class Deva {
487
490
  // create a hash for entire packet and insert into packet
488
491
  packet.hash = this.hash(JSON.stringify(packet));
489
492
 
490
- this.state('wait');
491
493
  this.talk(`log`, packet);
492
494
  return resolve(packet);
493
495
  }).catch(err => {
@@ -680,12 +682,15 @@ class Deva {
680
682
  Start Devas will initialize the Deva agents inside this curent Deva.
681
683
  ***************/
682
684
  startDevas() {
685
+ this.state('loading');
683
686
  return new Promise((resolve, reject) => {
687
+ this.prompt
684
688
  const devas = [];
685
689
  for (let x in this.devas) {
686
690
  devas.push(this.devas[x].init());
687
691
  }
688
692
  Promise.all(devas).then(() => {
693
+ this.state('done');
689
694
  return resolve(this.messages.loaded);
690
695
  }).catch(reject);
691
696
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indra.ai/deva",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "The Deva Core",
5
5
  "main": "index.js",
6
6
  "scripts": {