@indra.ai/deva 1.1.70 → 1.1.71
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 +14 -14
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -949,7 +949,7 @@ class Deva {
|
|
|
949
949
|
}
|
|
950
950
|
|
|
951
951
|
// hash the question
|
|
952
|
-
packet.q.meta.hash = this.hash(packet.q
|
|
952
|
+
packet.q.meta.hash = this.hash(packet.q);
|
|
953
953
|
|
|
954
954
|
this.action(_action);
|
|
955
955
|
this.talk('devacore:question', this.copy(packet)); // global question event make sure to copy data.
|
|
@@ -1024,10 +1024,10 @@ class Deva {
|
|
|
1024
1024
|
};
|
|
1025
1025
|
|
|
1026
1026
|
// create a hash for the answer and insert into answer meta.
|
|
1027
|
-
packet_answer.meta.hash = this.hash(packet_answer
|
|
1027
|
+
packet_answer.meta.hash = this.hash(packet_answer);
|
|
1028
1028
|
|
|
1029
1029
|
packet.a = packet_answer;
|
|
1030
|
-
packet.hash = this.hash(packet
|
|
1030
|
+
packet.hash = this.hash(packet); // hash the entire packet.
|
|
1031
1031
|
|
|
1032
1032
|
|
|
1033
1033
|
this.action('answer_talk');
|
|
@@ -1139,7 +1139,7 @@ class Deva {
|
|
|
1139
1139
|
text: this._messages.states.start,
|
|
1140
1140
|
created: Date.now(),
|
|
1141
1141
|
}
|
|
1142
|
-
_data.hash = this.hash(_data
|
|
1142
|
+
_data.hash = this.hash(_data);
|
|
1143
1143
|
|
|
1144
1144
|
// set client
|
|
1145
1145
|
this._active = Date.now();
|
|
@@ -1178,7 +1178,7 @@ class Deva {
|
|
|
1178
1178
|
for (let x in this._info) {
|
|
1179
1179
|
_info.push(`- ${x}: ${this._info[x]}`);
|
|
1180
1180
|
}
|
|
1181
|
-
_info.push(`::end:info:${this.hash(this._info
|
|
1181
|
+
_info.push(`::end:info:${this.hash(this._info)}`);
|
|
1182
1182
|
return _info.join('\n');
|
|
1183
1183
|
}
|
|
1184
1184
|
else {
|
|
@@ -1201,7 +1201,7 @@ class Deva {
|
|
|
1201
1201
|
if (!this._active) return Promise.resolve(this._messages.states.offline);
|
|
1202
1202
|
data.value = 'start';
|
|
1203
1203
|
delete data.hash;
|
|
1204
|
-
data.hash = this.hash(data
|
|
1204
|
+
data.hash = this.hash(data);
|
|
1205
1205
|
|
|
1206
1206
|
if (this.info) {
|
|
1207
1207
|
const _info = this.info(data.id);
|
|
@@ -1228,7 +1228,7 @@ class Deva {
|
|
|
1228
1228
|
if (!this._active) return Promise.resolve(this._messages.states.offline);
|
|
1229
1229
|
data.value = 'enter';
|
|
1230
1230
|
delete data.hash;
|
|
1231
|
-
data.hash = this.hash(data
|
|
1231
|
+
data.hash = this.hash(data);
|
|
1232
1232
|
const hasOnEnter = this.onEnter && typeof this.onEnter === 'function' ? true : false;
|
|
1233
1233
|
return hasOnEnter ? this.onEnter(_data) : this.done(data)
|
|
1234
1234
|
}
|
|
@@ -1249,7 +1249,7 @@ class Deva {
|
|
|
1249
1249
|
if (!this._active) return Promise.resolve(this._messages.states.offline);
|
|
1250
1250
|
data.value = 'done';
|
|
1251
1251
|
delete data.hash;
|
|
1252
|
-
data.hash = this.hash(data
|
|
1252
|
+
data.hash = this.hash(data);
|
|
1253
1253
|
const hasOnDone = this.onDone && typeof this.onDone === 'function' ? true : false;
|
|
1254
1254
|
return hasOnDone ? this.onDone(data) : Promise.resolve(data);
|
|
1255
1255
|
}
|
|
@@ -1279,7 +1279,7 @@ class Deva {
|
|
|
1279
1279
|
text: this._messages.states.stop,
|
|
1280
1280
|
created: Date.now(),
|
|
1281
1281
|
}
|
|
1282
|
-
_data.hash = this.hash(_data
|
|
1282
|
+
_data.hash = this.hash(_data);
|
|
1283
1283
|
const hasOnStop = this.onStop && typeof this.onStop === 'function';
|
|
1284
1284
|
return hasOnStop ? this.onStop(_data) : this.exit(_data)
|
|
1285
1285
|
}
|
|
@@ -1304,7 +1304,7 @@ class Deva {
|
|
|
1304
1304
|
this._active = false;
|
|
1305
1305
|
data.value = 'exit';
|
|
1306
1306
|
delete data.hash;
|
|
1307
|
-
data.hash = this.hash(data
|
|
1307
|
+
data.hash = this.hash(data);
|
|
1308
1308
|
|
|
1309
1309
|
// clear memory
|
|
1310
1310
|
this._active = false;
|
|
@@ -1344,7 +1344,7 @@ class Deva {
|
|
|
1344
1344
|
text,
|
|
1345
1345
|
created: Date.now(),
|
|
1346
1346
|
};
|
|
1347
|
-
_data.hash = this.hash(_data
|
|
1347
|
+
_data.hash = this.hash(_data);
|
|
1348
1348
|
this.talk('devacore:state', _data);
|
|
1349
1349
|
} catch (e) {
|
|
1350
1350
|
return this.error(e);
|
|
@@ -1371,7 +1371,7 @@ class Deva {
|
|
|
1371
1371
|
data,
|
|
1372
1372
|
created: Date.now(),
|
|
1373
1373
|
};
|
|
1374
|
-
_data.hash = this.hash(_data
|
|
1374
|
+
_data.hash = this.hash(_data);
|
|
1375
1375
|
this.talk('devacore:zone', _data);
|
|
1376
1376
|
} catch (e) {
|
|
1377
1377
|
return this.error(e);
|
|
@@ -1398,7 +1398,7 @@ class Deva {
|
|
|
1398
1398
|
text,
|
|
1399
1399
|
created: Date.now(),
|
|
1400
1400
|
};
|
|
1401
|
-
_data.hash = this.hash(_data
|
|
1401
|
+
_data.hash = this.hash(_data);
|
|
1402
1402
|
this.talk('devacore:action', _data);
|
|
1403
1403
|
} catch (e) {
|
|
1404
1404
|
return this.error(e)
|
|
@@ -1425,7 +1425,7 @@ class Deva {
|
|
|
1425
1425
|
data,
|
|
1426
1426
|
created: Date.now(),
|
|
1427
1427
|
};
|
|
1428
|
-
_data.hash = this.hash(_data
|
|
1428
|
+
_data.hash = this.hash(_data);
|
|
1429
1429
|
this.talk('devacore:feature', _data);
|
|
1430
1430
|
} catch (e) {
|
|
1431
1431
|
return this.error(e);
|