@indra.ai/deva 1.6.99 β 1.6.101
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/config/index.js +8 -0
- package/config/states.json +1 -0
- package/config/zones.json +2 -1
- package/index.js +15 -1
- package/package.json +1 -1
package/config/index.js
CHANGED
package/config/states.json
CHANGED
package/config/zones.json
CHANGED
package/index.js
CHANGED
|
@@ -16,6 +16,7 @@ class Deva {
|
|
|
16
16
|
this._id = opts.id || randomUUID(); // the unique id assigned to the agent at load
|
|
17
17
|
this._info = opts.info || false; // the deva information from the package file.
|
|
18
18
|
this._config = opts.config || {}; // local Config Object
|
|
19
|
+
this._config.ready_hash = config.ready_hash; // items to hash at ready
|
|
19
20
|
this._agent = opts.agent || false; // Agent profile object
|
|
20
21
|
this._client = {}; // this will be set on init.
|
|
21
22
|
this._active = false; // the active/birth date.
|
|
@@ -64,7 +65,6 @@ class Deva {
|
|
|
64
65
|
|
|
65
66
|
this._uid = config.uid; // set the uid options
|
|
66
67
|
|
|
67
|
-
|
|
68
68
|
this._events = config.events; // set the core system events
|
|
69
69
|
this._feature = config.feature; // set the feature from config data.
|
|
70
70
|
this._features = config.features; // set the features from config data.
|
|
@@ -1227,6 +1227,9 @@ class Deva {
|
|
|
1227
1227
|
this.action('ready', data.id.uid);
|
|
1228
1228
|
this.state('ready', data.id.uid);
|
|
1229
1229
|
|
|
1230
|
+
const agent = this.agent();
|
|
1231
|
+
const client = this.client();
|
|
1232
|
+
|
|
1230
1233
|
// Delete previous data hashes
|
|
1231
1234
|
this.action('delete', `done:md5:${data.id.uid}`);
|
|
1232
1235
|
delete data.md5;
|
|
@@ -1238,6 +1241,16 @@ class Deva {
|
|
|
1238
1241
|
this.state('set', `data:value:ready:${data.id.uid}`); // state set to watch OnFinish
|
|
1239
1242
|
data.value = 'ready';
|
|
1240
1243
|
|
|
1244
|
+
this.state('set', `config:hash:${data.id.uid}`); // state set to watch OnFinish
|
|
1245
|
+
this.config.hash[agent.key] = {};
|
|
1246
|
+
for (let item of this._config.ready_hash) {
|
|
1247
|
+
if (this[item]) {
|
|
1248
|
+
const this_item = this[item];
|
|
1249
|
+
this.action('hash', `${agent.key}:config:${item}:${data.id.uid}`);
|
|
1250
|
+
this.config.hash[agent.key][item] = this.hash(this_item, 'sha256');
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1241
1254
|
this.action('hash', `ready:md5:${data.id.uid}`);
|
|
1242
1255
|
data.md5 = this.hash(data, 'md5');
|
|
1243
1256
|
this.action('hash', `ready:sha256:${data.id.uid}`)
|
|
@@ -1248,6 +1261,7 @@ class Deva {
|
|
|
1248
1261
|
this.action('talk', `${this._events.ready}:${data.id.uid}`);
|
|
1249
1262
|
this.talk(this._events.ready, data);
|
|
1250
1263
|
|
|
1264
|
+
|
|
1251
1265
|
const hasOnReady = this.onReady && typeof this.onReady === 'function';
|
|
1252
1266
|
if (hasOnReady) {
|
|
1253
1267
|
this.action('onfunc', `hasOnReady:${data.id.uid}`); // action onfunc
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "44091450722329207445",
|
|
3
3
|
"name": "@indra.ai/deva",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.101",
|
|
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:44091450722329207445 LICENSE.md",
|