@indra.ai/deva 1.1.73 → 1.1.75
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.json +1 -1
- package/index.js +25 -24
- package/package.json +1 -1
package/config.json
CHANGED
package/index.js
CHANGED
|
@@ -486,8 +486,8 @@ class Deva {
|
|
|
486
486
|
global: mind.global, // the global policies for client
|
|
487
487
|
personal: mind.devas[this._agent.key], // Client personal features and rules.
|
|
488
488
|
};
|
|
489
|
-
delete this._client.features.mind;
|
|
490
|
-
return this.Done();
|
|
489
|
+
delete this._client.features.mind; // delete the mind feature from client data
|
|
490
|
+
return this.Done(); // when complete then move to the done feature.
|
|
491
491
|
}
|
|
492
492
|
} catch (e) {
|
|
493
493
|
this.action('error'); // set the action to error
|
|
@@ -929,6 +929,26 @@ class Deva {
|
|
|
929
929
|
// now when we ask the meta params[0] should be the method
|
|
930
930
|
}
|
|
931
931
|
|
|
932
|
+
info(id=false) {
|
|
933
|
+
id = id || this._id;
|
|
934
|
+
const agent = this.agent();
|
|
935
|
+
if (this._info) {
|
|
936
|
+
const _info = [
|
|
937
|
+
`::begin:info:${id}`,
|
|
938
|
+
`## ${this._agent.profile.name} (#${agent.key})`,
|
|
939
|
+
];
|
|
940
|
+
for (let x in this._info) {
|
|
941
|
+
_info.push(`- ${x}: ${this._info[x]}`);
|
|
942
|
+
}
|
|
943
|
+
_info.push(`::end:info:${this.hash(this._info)}`);
|
|
944
|
+
return _info.join('\n');
|
|
945
|
+
}
|
|
946
|
+
else {
|
|
947
|
+
return '';
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
|
|
932
952
|
|
|
933
953
|
/**************
|
|
934
954
|
func: init
|
|
@@ -983,25 +1003,6 @@ class Deva {
|
|
|
983
1003
|
});
|
|
984
1004
|
}
|
|
985
1005
|
|
|
986
|
-
info(id=false) {
|
|
987
|
-
id = id || this._id;
|
|
988
|
-
const agent = this.agent();
|
|
989
|
-
if (this._info) {
|
|
990
|
-
const _info = [
|
|
991
|
-
`::begin:info:${id}`,
|
|
992
|
-
`## ${this._agent.profile.name} (#${agent.key})`,
|
|
993
|
-
];
|
|
994
|
-
for (let x in this._info) {
|
|
995
|
-
_info.push(`- ${x}: ${this._info[x]}`);
|
|
996
|
-
}
|
|
997
|
-
_info.push(`::end:info:${this.hash(this._info)}`);
|
|
998
|
-
return _info.join('\n');
|
|
999
|
-
}
|
|
1000
|
-
else {
|
|
1001
|
-
return '';
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
1006
|
/**************
|
|
1006
1007
|
func: start
|
|
1007
1008
|
params:
|
|
@@ -1012,7 +1013,7 @@ class Deva {
|
|
|
1012
1013
|
function or running the system enter function.
|
|
1013
1014
|
usage: this.start('msg')
|
|
1014
1015
|
***************/
|
|
1015
|
-
start(data
|
|
1016
|
+
start(data) {
|
|
1016
1017
|
this.state('start');
|
|
1017
1018
|
if (!this._active) return Promise.resolve(this._messages.states.offline);
|
|
1018
1019
|
data.value = 'start';
|
|
@@ -1039,14 +1040,14 @@ class Deva {
|
|
|
1039
1040
|
If the Deva is offline it will return the offline message.
|
|
1040
1041
|
usage: this.enter('msg')
|
|
1041
1042
|
***************/
|
|
1042
|
-
enter(data
|
|
1043
|
+
enter(data) {
|
|
1043
1044
|
this.state('enter');
|
|
1044
1045
|
if (!this._active) return Promise.resolve(this._messages.states.offline);
|
|
1045
1046
|
data.value = 'enter';
|
|
1046
1047
|
delete data.hash;
|
|
1047
1048
|
data.hash = this.hash(data);
|
|
1048
1049
|
const hasOnEnter = this.onEnter && typeof this.onEnter === 'function' ? true : false;
|
|
1049
|
-
return hasOnEnter ? this.onEnter(
|
|
1050
|
+
return hasOnEnter ? this.onEnter(data) : this.done(data)
|
|
1050
1051
|
}
|
|
1051
1052
|
|
|
1052
1053
|
/**************
|