@indra.ai/deva 1.1.102 → 1.1.103
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 +21 -15
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -959,12 +959,12 @@ class Deva {
|
|
|
959
959
|
init(client) {
|
|
960
960
|
// set client
|
|
961
961
|
this._active = Date.now();
|
|
962
|
-
|
|
962
|
+
const agent = this.agent();
|
|
963
963
|
const _data = {
|
|
964
964
|
id: this.uid(true),
|
|
965
|
-
key: '
|
|
966
|
-
value:
|
|
967
|
-
agent
|
|
965
|
+
key: 'init',
|
|
966
|
+
value: agent.key,
|
|
967
|
+
agent,
|
|
968
968
|
client: this.copy(client),
|
|
969
969
|
text: this._messages.states.start,
|
|
970
970
|
created: Date.now(),
|
|
@@ -1099,12 +1099,14 @@ class Deva {
|
|
|
1099
1099
|
stop() {
|
|
1100
1100
|
if (!this._active) return Promise.resolve(this._messages.states.offline);
|
|
1101
1101
|
this.state('stop');
|
|
1102
|
+
const agent = this.agent();
|
|
1103
|
+
const client = this.client();
|
|
1102
1104
|
const data = {
|
|
1103
1105
|
id: this.uid(true),
|
|
1104
|
-
key: '
|
|
1105
|
-
value:
|
|
1106
|
-
agent
|
|
1107
|
-
client
|
|
1106
|
+
key: 'stop',
|
|
1107
|
+
value: agent.key,
|
|
1108
|
+
agent,
|
|
1109
|
+
client,
|
|
1108
1110
|
text: this._messages.states.stop,
|
|
1109
1111
|
created: Date.now(),
|
|
1110
1112
|
}
|
|
@@ -1663,12 +1665,14 @@ class Deva {
|
|
|
1663
1665
|
***************/
|
|
1664
1666
|
prompt(text) {
|
|
1665
1667
|
// Talk a global prompt event for the client
|
|
1668
|
+
const agent = this.agent();
|
|
1669
|
+
const client = this.client();
|
|
1666
1670
|
const _data = {
|
|
1667
1671
|
id: this.uid(true),
|
|
1668
1672
|
key: 'prompt',
|
|
1669
|
-
value:
|
|
1670
|
-
agent
|
|
1671
|
-
client
|
|
1673
|
+
value: agent.key,
|
|
1674
|
+
agent,
|
|
1675
|
+
client,
|
|
1672
1676
|
text,
|
|
1673
1677
|
created: Date.now(),
|
|
1674
1678
|
}
|
|
@@ -1908,12 +1912,14 @@ class Deva {
|
|
|
1908
1912
|
console.log('\n::END:DATA\n');
|
|
1909
1913
|
}
|
|
1910
1914
|
|
|
1915
|
+
const agent = this.agent();
|
|
1916
|
+
const client = this.client();
|
|
1911
1917
|
const _data = {
|
|
1912
1918
|
id: this.uid(true),
|
|
1913
|
-
key: '
|
|
1914
|
-
value:
|
|
1915
|
-
agent
|
|
1916
|
-
client
|
|
1919
|
+
key: 'error',
|
|
1920
|
+
value: agent.key,
|
|
1921
|
+
agent,
|
|
1922
|
+
client,
|
|
1917
1923
|
error: err,
|
|
1918
1924
|
data,
|
|
1919
1925
|
created: Date.now(),
|