@indra.ai/deva 1.1.19 → 1.1.21

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.
Files changed (2) hide show
  1. package/index.js +9 -8
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -54,6 +54,7 @@ class Deva {
54
54
  ask: '🙋‍♀️ ASK',
55
55
  cmd: '📟 COMMAND',
56
56
  question: '🐵 QUESTION',
57
+ question_me: '🐵 QUESTION',
57
58
  question_ask: '🧙‍♂️ QUESTION ASK',
58
59
  question_cmd: '🪄 QUESTION CMD',
59
60
  question_answer: '🔮 QUESTION ANSWER',
@@ -165,6 +166,13 @@ class Deva {
165
166
  try {
166
167
  // set the assigned listeners for the agent.
167
168
  for (let listener in this.listeners) {
169
+ // set the default listeners for the states of the agent.
170
+ for (let state in this._states) {
171
+ this.events.on(`${this.agent.key}:${state}`, packet => {
172
+ return this[state](packet);
173
+ })
174
+ }
175
+
168
176
  this.events.on(listener, packet => {
169
177
  return this.listeners[listener](packet);
170
178
  })
@@ -190,13 +198,6 @@ class Deva {
190
198
  ***************/
191
199
  _assignInherit() {
192
200
  return new Promise((resolve, reject) => {
193
- // set the default listeners for the states of the agent.
194
- for (let state in this._states) {
195
- this.events.on(`${this.agent.key}:${state}`, packet => {
196
- return this[state](packet);
197
- })
198
- }
199
-
200
201
  try {
201
202
  for (let d in this.devas) {
202
203
  this.inherit.forEach(inherit => {
@@ -462,7 +463,7 @@ class Deva {
462
463
  // #agent method:param1:param2 with text strings for proccessing
463
464
  // !method param:list:parse for the local agent
464
465
  // if is an ask then we format one way
465
- let _state = 'question';
466
+ let _state = 'question_me';
466
467
  if (isAsk) {
467
468
  _state = 'question_ask'
468
469
  key = t_split[0].substring(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indra.ai/deva",
3
- "version": "1.1.19",
3
+ "version": "1.1.21",
4
4
  "description": "The Deva Core",
5
5
  "main": "index.js",
6
6
  "scripts": {