@indra.ai/deva 1.6.99 → 1.6.100

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 CHANGED
@@ -29,6 +29,14 @@ export default {
29
29
  'func',
30
30
  'lib'
31
31
  ],
32
+ ready_hash: [
33
+ "vars",
34
+ "utils",
35
+ "listeners",
36
+ "modules",
37
+ "func",
38
+ "methods"
39
+ ],
32
40
  context: false,
33
41
  events: events.DATA,
34
42
  feature: false,
package/config/zones.json CHANGED
@@ -64,6 +64,7 @@
64
64
  "private": "🤫 Private",
65
65
  "public": "😀 Public",
66
66
  "merit": "➕ Merit",
67
- "demerit": "➖ Demerit"
67
+ "demerit": "➖ Demerit",
68
+ "outcast": "🏚️ Outcast"
68
69
  }
69
70
  }
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.99",
4
+ "version": "1.6.100",
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",