@indra.ai/deva 1.29.0 → 1.29.1
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.
- package/index.js +22 -17
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1411,21 +1411,26 @@ class Deva {
|
|
|
1411
1411
|
}
|
|
1412
1412
|
// check if the entity has devas to load after everything is ready.
|
|
1413
1413
|
// load the devas
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1414
|
+
let deva;
|
|
1415
|
+
try {
|
|
1416
|
+
if (this.devas && Object.keys(this.devas).length) {
|
|
1417
|
+
for (deva in this.devas) {
|
|
1418
|
+
await this.load(deva, data.client);
|
|
1419
|
+
// after the deva loads talk the event to set asset directory.
|
|
1420
|
+
const id = this.devas[deva].uid();
|
|
1421
|
+
const {dir} = this.devas[deva].info();
|
|
1422
|
+
const {key} = this.devas[deva].agent();
|
|
1423
|
+
this.talk(`deva:dir`, {id, key,dir});
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
catch (err) {
|
|
1428
|
+
return this.err(err, deva);
|
|
1429
|
+
}
|
|
1430
|
+
finally {
|
|
1431
|
+
// return the invoke in a set immediate so it runs after the loop
|
|
1432
|
+
return this._invoke({key,data,resolve});
|
|
1433
|
+
}
|
|
1429
1434
|
}
|
|
1430
1435
|
|
|
1431
1436
|
/**************
|
|
@@ -2153,12 +2158,12 @@ class Deva {
|
|
|
2153
2158
|
-deva: The Deva model to load.
|
|
2154
2159
|
describe: This function will enable fast loading of Deva into the system.
|
|
2155
2160
|
***************/
|
|
2156
|
-
load(key, client) {
|
|
2161
|
+
async load(key, client) {
|
|
2157
2162
|
this.zone('load', key);
|
|
2158
2163
|
this.action('load', key);
|
|
2159
2164
|
this.state('load', key);
|
|
2160
2165
|
this.intent('good', `load:${key}`);
|
|
2161
|
-
return this.devas[key].init(client);
|
|
2166
|
+
return await this.devas[key].init(client);
|
|
2162
2167
|
}
|
|
2163
2168
|
|
|
2164
2169
|
/**************
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "38159520729793885324",
|
|
3
3
|
"name": "@indra.ai/deva",
|
|
4
|
-
"version": "1.29.
|
|
4
|
+
"version": "1.29.1",
|
|
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",
|