@indra.ai/deva 1.29.15 → 1.29.17
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 +16 -19
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -310,10 +310,10 @@ class Deva {
|
|
|
310
310
|
init, start, enter, done ready, finish, complete
|
|
311
311
|
usage: this.complete(data, resolve)
|
|
312
312
|
***************/
|
|
313
|
-
|
|
313
|
+
_invoke(opts) {
|
|
314
314
|
if (!this._active) return resolve(this._messages.offline);
|
|
315
315
|
const {key, data, resolve} = opts;
|
|
316
|
-
const {prev_key, next_key, onfunc, clear} = config.invoke[key];
|
|
316
|
+
const {prev_key, next_key, onfunc, clear, load} = config.invoke[key];
|
|
317
317
|
this.action('invoke', `${key}:${data.id.uid}`);
|
|
318
318
|
this.context(key, data.id.uid);
|
|
319
319
|
this.zone(key, data.id.uid);
|
|
@@ -1346,7 +1346,7 @@ class Deva {
|
|
|
1346
1346
|
sequence. This design preserves language-agnostic interoperability and
|
|
1347
1347
|
deterministic state transitions across Deva systems.
|
|
1348
1348
|
***************/
|
|
1349
|
-
|
|
1349
|
+
start(data, resolve) {
|
|
1350
1350
|
if (!this._active) return resolve(this._messages.offline);
|
|
1351
1351
|
return this._invoke({key:'start',data,resolve});
|
|
1352
1352
|
}
|
|
@@ -1362,7 +1362,7 @@ class Deva {
|
|
|
1362
1362
|
If the Deva is offline it will return the offline message.
|
|
1363
1363
|
usage: this.enter('msg')
|
|
1364
1364
|
***************/
|
|
1365
|
-
|
|
1365
|
+
enter(data, resolve) {
|
|
1366
1366
|
if (!this._active) return resolve(this._messages.offline);
|
|
1367
1367
|
return this._invoke({key:'enter',data,resolve});
|
|
1368
1368
|
}
|
|
@@ -1378,26 +1378,23 @@ class Deva {
|
|
|
1378
1378
|
If the deva is offline it will return the offline message.
|
|
1379
1379
|
usage: this.done('msg')
|
|
1380
1380
|
***************/
|
|
1381
|
-
|
|
1381
|
+
done(data, resolve) {
|
|
1382
1382
|
if (!this._active) return resolve(this._messages.offline);
|
|
1383
1383
|
|
|
1384
1384
|
if (this.devas && Object.keys(this.devas).length) {
|
|
1385
1385
|
for (let deva in this.devas) {
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
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
|
+
});
|
|
1392
1395
|
}
|
|
1393
|
-
// return immedate on async
|
|
1394
|
-
return setImmediate(() => {
|
|
1395
|
-
return this._invoke({key:'done',data,resolve});
|
|
1396
|
-
});
|
|
1397
1396
|
}
|
|
1398
|
-
|
|
1399
|
-
return this._invoke({key:'done',data,resolve});
|
|
1400
|
-
}
|
|
1397
|
+
return this._invoke({key:'done',data,resolve});
|
|
1401
1398
|
}
|
|
1402
1399
|
|
|
1403
1400
|
/**************
|
|
@@ -1408,7 +1405,7 @@ class Deva {
|
|
|
1408
1405
|
describe: This function is use to relay the to the ready state.
|
|
1409
1406
|
usage: this.ready(data, resolve)
|
|
1410
1407
|
***************/
|
|
1411
|
-
|
|
1408
|
+
ready(data, resolve) {
|
|
1412
1409
|
if (!this._active) return resolve(this._messages.offline);
|
|
1413
1410
|
const key = 'ready';
|
|
1414
1411
|
|
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.17",
|
|
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",
|