@indra.ai/deva 1.29.17 → 1.29.19

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 +13 -16
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1380,20 +1380,6 @@ class Deva {
1380
1380
  ***************/
1381
1381
  done(data, resolve) {
1382
1382
  if (!this._active) return resolve(this._messages.offline);
1383
-
1384
- if (this.devas && Object.keys(this.devas).length) {
1385
- for (let deva in this.devas) {
1386
- setImmediate(() => {
1387
- this.load(deva, data.client);
1388
- // after the deva loads talk the event to set asset directory.
1389
- const id = this.uid();
1390
- const {dir} = this.devas[deva].info();
1391
- const {key} = this.devas[deva].agent();
1392
- this.talk(`deva:dir`, {id, key,dir});
1393
-
1394
- });
1395
- }
1396
- }
1397
1383
  return this._invoke({key:'done',data,resolve});
1398
1384
  }
1399
1385
 
@@ -1405,7 +1391,7 @@ class Deva {
1405
1391
  describe: This function is use to relay the to the ready state.
1406
1392
  usage: this.ready(data, resolve)
1407
1393
  ***************/
1408
- ready(data, resolve) {
1394
+ async ready(data, resolve) {
1409
1395
  if (!this._active) return resolve(this._messages.offline);
1410
1396
  const key = 'ready';
1411
1397
 
@@ -1424,7 +1410,18 @@ class Deva {
1424
1410
  this.config.hash[agent.key][item] = this.hash(this_item, 'sha256');
1425
1411
  }
1426
1412
  }
1427
- return this._invoke({key,data,resolve});
1413
+ const keys = Object.keys(this.devas);
1414
+ if (this.devas && keys.length) {
1415
+ for (let deva in this.devas) {
1416
+ await this.load(deva, data.client).then(entity => {
1417
+ const id = this.uid();
1418
+ const {dir} = this.devas[deva].info();
1419
+ const {key} = this.devas[deva].agent();
1420
+ this.talk(`deva:dir`, {id, key, dir});
1421
+ });
1422
+ }
1423
+ }
1424
+ return this._invoke({key,data,resolve});
1428
1425
  }
1429
1426
 
1430
1427
  /**************
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "38159520729793885324",
3
3
  "name": "@indra.ai/deva",
4
- "version": "1.29.17",
4
+ "version": "1.29.19",
5
5
  "description": "Deva Core a Vedic-inspired Event Based Context Aware Feature, Zone, Action, and State Machine integrated Artificial Intelligence Framework",
6
6
  "main": "index.js",
7
7
  "license": "VLA:38159520729793885324 LICENSE.md",