@indra.ai/deva 1.5.31 → 1.5.33
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 +13 -12
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1436,8 +1436,8 @@ class Deva {
|
|
|
1436
1436
|
usage: this.prompt('text')
|
|
1437
1437
|
***************/
|
|
1438
1438
|
prompt(text) {
|
|
1439
|
+
if (!this._active) return this._messages.offline;
|
|
1439
1440
|
const id = this.lib.uid();
|
|
1440
|
-
if (!this._active) return Promise.resolve(this._messages.offline);
|
|
1441
1441
|
// Talk a global prompt event for the client
|
|
1442
1442
|
const agent = this.agent();
|
|
1443
1443
|
const client = this.client();
|
|
@@ -1569,16 +1569,16 @@ class Deva {
|
|
|
1569
1569
|
The error function provides the consistent error manage of the system.
|
|
1570
1570
|
usage: this.error(err, data, reject);
|
|
1571
1571
|
***************/
|
|
1572
|
-
error(err,
|
|
1572
|
+
error(err,packet,reject=false) {
|
|
1573
1573
|
const id = this.lib.uid();
|
|
1574
1574
|
this.zone('error', id);
|
|
1575
|
-
this.action('error', id);
|
|
1576
|
-
this.state('error', id);
|
|
1577
|
-
this.context('error', id);
|
|
1578
|
-
|
|
1579
1575
|
const agent = this.agent();
|
|
1580
1576
|
const client = this.client();
|
|
1581
|
-
|
|
1577
|
+
|
|
1578
|
+
this.action('error', id);
|
|
1579
|
+
const hasOnError = this.onError && typeof this.onError === 'function' ? true : false;
|
|
1580
|
+
|
|
1581
|
+
const data = {
|
|
1582
1582
|
id,
|
|
1583
1583
|
key: 'error',
|
|
1584
1584
|
value: agent.key,
|
|
@@ -1592,13 +1592,14 @@ class Deva {
|
|
|
1592
1592
|
data,
|
|
1593
1593
|
created: Date.now(),
|
|
1594
1594
|
}
|
|
1595
|
-
|
|
1596
|
-
this.talk(config.events.error, this.lib.copy(
|
|
1597
|
-
const hasOnError = this.onError && typeof this.onError === 'function' ? true : false;
|
|
1595
|
+
data.hash = this.lib.hash(data);
|
|
1596
|
+
this.talk(config.events.error, this.lib.copy(data));
|
|
1598
1597
|
|
|
1599
1598
|
this.state('return', `error:${id}`);
|
|
1600
|
-
|
|
1601
|
-
|
|
1599
|
+
this.state('error', id);
|
|
1600
|
+
this.context('error', id);
|
|
1601
|
+
if (hasOnError) return this.onError(err, packet, reject);
|
|
1602
|
+
else return reject ? reject(err) : Promise.reject(err);
|
|
1602
1603
|
}
|
|
1603
1604
|
|
|
1604
1605
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indra.ai/deva",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.33",
|
|
4
4
|
"description": "The Deva Core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"copyright": "(c)2025 Quinn Michaels; All rights reserved.",
|
|
@@ -250,7 +250,7 @@
|
|
|
250
250
|
},
|
|
251
251
|
"message": "offline",
|
|
252
252
|
"messages": {
|
|
253
|
-
"init": "🟠
|
|
253
|
+
"init": "🟠 INIT",
|
|
254
254
|
"start": "🟢 START",
|
|
255
255
|
"enter": "🔵 ENTER",
|
|
256
256
|
"done": "🟣 DONE",
|