@indra.ai/deva 1.1.0 → 1.1.2
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 +4 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -78,6 +78,7 @@ class Deva {
|
|
|
78
78
|
***************/
|
|
79
79
|
state(st) {
|
|
80
80
|
this._state = this._states[st];
|
|
81
|
+
this.prompt(this._state);
|
|
81
82
|
this.talk(`${this.agent.id}:state`, this._state);
|
|
82
83
|
}
|
|
83
84
|
|
|
@@ -605,7 +606,8 @@ class Deva {
|
|
|
605
606
|
exit() {
|
|
606
607
|
if (!this.active) return Promise.resolve(this.messages.offline);
|
|
607
608
|
this.state('exit');
|
|
608
|
-
|
|
609
|
+
this.active = false;
|
|
610
|
+
return this.onExit && typeof this.onExit === 'function' ? this.onExit() : Promise.resolve(this._state)
|
|
609
611
|
}
|
|
610
612
|
|
|
611
613
|
/**************
|
|
@@ -622,7 +624,7 @@ class Deva {
|
|
|
622
624
|
if (!this.active) return Promise.resolve(this.messages.offline);
|
|
623
625
|
this.state('done');
|
|
624
626
|
msg = msg ? msg : this._state;
|
|
625
|
-
return this.onDone && typeof this.onDone === 'function' ? this.onDone() : Promise.resolve(
|
|
627
|
+
return this.onDone && typeof this.onDone === 'function' ? this.onDone() : Promise.resolve(this._state)
|
|
626
628
|
}
|
|
627
629
|
|
|
628
630
|
/**************
|