@indra.ai/deva 1.6.51 → 1.6.53

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 +12 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -796,7 +796,7 @@ class Deva {
796
796
  created: Date.now(), // set the created date for the answer
797
797
  };
798
798
  // create a hash for the answer and insert into answer meta.
799
- packet_answer.md5 = this.lib.hash(packet_answer);
799
+ packet_answer.md5 = this.lib.hash(packet_answer, 'md5');
800
800
  packet_answer.sha256 = this.lib.hash(packet_answer, 'sha256');
801
801
  packet_answer.sha512 = this.lib.hash(packet_answer, 'sha512');
802
802
 
@@ -872,12 +872,21 @@ class Deva {
872
872
  else {
873
873
  packet_answer.text = result;
874
874
  }
875
-
876
- packet_answer.md5 = this.lib.hash(packet_answer);
875
+
876
+ packet_answer.md5 = this.lib.hash(packet_answer, 'md5');
877
877
  packet_answer.sha256 = this.lib.hash(packet_answer, 'sha256');
878
878
  packet_answer.sha512 = this.lib.hash(packet_answer, 'sha512');
879
879
 
880
+ packet.q.agent = agent;
880
881
  packet.a = packet_answer;
882
+
883
+ delete packet.md5;
884
+ delete packet.sha256;
885
+ delete packet.sha512;
886
+ packet.md5 = this.lib.hash(packet, 'md5');
887
+ packet.sha256 = this.lib.hash(packet, 'sha256');
888
+ packet.sha512 = this.lib.hash(packet, 'sha512');
889
+
881
890
  this.talk(config.events.answer, this.lib.copy(packet)); // global talk event
882
891
  this.talk(`${agent.key}:ask:${packet.id.uid}`, packet);
883
892
  }).catch(err => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": 45958588982385560000,
3
3
  "name": "@indra.ai/deva",
4
- "version": "1.6.51",
4
+ "version": "1.6.53",
5
5
  "description": "The Deva Core",
6
6
  "main": "index.js",
7
7
  "license": "VLA:45958588982385558603 LICENSE.md",