@indra.ai/deva 1.6.82 β 1.6.84
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/states.json +0 -6
- package/index.js +22 -14
- package/package.json +1 -1
- package/tests/index.js +2 -21
package/config/states.json
CHANGED
|
@@ -4,10 +4,6 @@
|
|
|
4
4
|
"copyright": "Β©2025 Quinn A Michaels; All rights reserved. ",
|
|
5
5
|
"VLA": "25552873878502387963",
|
|
6
6
|
"DATA": {
|
|
7
|
-
"usa": "πΊπΈ United States of America",
|
|
8
|
-
"england": "π¬π§ England",
|
|
9
|
-
"germany": "π©πͺ Germany",
|
|
10
|
-
"russia": "π·πΊ Russia",
|
|
11
7
|
"online": "π€© Online",
|
|
12
8
|
"offline": "π΄ Offline",
|
|
13
9
|
"active": "π Active",
|
|
@@ -112,8 +108,6 @@
|
|
|
112
108
|
"incorrect": "π₯ Incorrect",
|
|
113
109
|
"clean": "π§Ό Clean",
|
|
114
110
|
"dirty": "π§Ή Dirty",
|
|
115
|
-
"wager": "οΉ© Wager",
|
|
116
|
-
"gamble": "βΏ Gamble",
|
|
117
111
|
"friend": "π¦Έ Friend",
|
|
118
112
|
"enemy": "π¦Ή Enemy",
|
|
119
113
|
"fake": "π₯Έ Fake",
|
package/index.js
CHANGED
|
@@ -1068,6 +1068,7 @@ class Deva {
|
|
|
1068
1068
|
usage: this.start('msg')
|
|
1069
1069
|
***************/
|
|
1070
1070
|
start(data, resolve) {
|
|
1071
|
+
this.context('start', data.id.uid);
|
|
1071
1072
|
this.zone('start', data.id.uid);
|
|
1072
1073
|
if (!this._active) return resolve(this._messages.offline);
|
|
1073
1074
|
|
|
@@ -1103,6 +1104,7 @@ class Deva {
|
|
|
1103
1104
|
usage: this.enter('msg')
|
|
1104
1105
|
***************/
|
|
1105
1106
|
enter(data, resolve) {
|
|
1107
|
+
this.context('enter', data.id.uid);
|
|
1106
1108
|
this.zone('enter', data.id.uid);
|
|
1107
1109
|
if (!this._active) return resolve(this._messages.offline);
|
|
1108
1110
|
|
|
@@ -1136,6 +1138,7 @@ class Deva {
|
|
|
1136
1138
|
usage: this.done('msg')
|
|
1137
1139
|
***************/
|
|
1138
1140
|
done(data, resolve) {
|
|
1141
|
+
this.context('done', data.id.uid);
|
|
1139
1142
|
this.zone('done', data.id.uid);
|
|
1140
1143
|
if (!this._active) return resolve(this._messages.offline);
|
|
1141
1144
|
|
|
@@ -1166,6 +1169,7 @@ class Deva {
|
|
|
1166
1169
|
usage: this.ready(data, resolve)
|
|
1167
1170
|
***************/
|
|
1168
1171
|
ready(data, resolve) {
|
|
1172
|
+
this.context('ready', data.id.uid);
|
|
1169
1173
|
this.zone('ready', data.id.uid);
|
|
1170
1174
|
if (!this._active) return resolve(this._messages.offline);
|
|
1171
1175
|
|
|
@@ -1198,8 +1202,9 @@ class Deva {
|
|
|
1198
1202
|
usage: this.finish(data, resolve)
|
|
1199
1203
|
***************/
|
|
1200
1204
|
finish(data, resolve) {
|
|
1201
|
-
this.zone('finish', data.id.uid); // enter finish zone
|
|
1202
1205
|
if (!this._active) return resolve(this._messages.offline); //
|
|
1206
|
+
this.context('finish', data.id.uid);
|
|
1207
|
+
this.zone('finish', data.id.uid); // enter finish zone
|
|
1203
1208
|
|
|
1204
1209
|
this.action('finish', data.id.uid); // start finish action
|
|
1205
1210
|
const hasOnFinish = this.onFinish && typeof this.onFinish === 'function';
|
|
@@ -1229,8 +1234,9 @@ class Deva {
|
|
|
1229
1234
|
usage: this.complete(data, resolve)
|
|
1230
1235
|
***************/
|
|
1231
1236
|
complete(data, resolve) {
|
|
1232
|
-
this.zone('complete', data.id.uid);
|
|
1233
1237
|
if (!this._active) return Promise.resolve(this._messages.offline);
|
|
1238
|
+
this.context('complete', data.id.uid);
|
|
1239
|
+
this.zone('complete', data.id.uid);
|
|
1234
1240
|
|
|
1235
1241
|
this.action('complete', data.id.uid);
|
|
1236
1242
|
const hasOnComplete = this.onComplete && typeof this.onComplete === 'function';
|
|
@@ -1263,9 +1269,10 @@ class Deva {
|
|
|
1263
1269
|
this.stop()
|
|
1264
1270
|
***************/
|
|
1265
1271
|
stop() {
|
|
1272
|
+
if (!this._active) return Promise.resolve(this._messages.offline);
|
|
1266
1273
|
const id = this.uid();
|
|
1274
|
+
this.context('stop', id);
|
|
1267
1275
|
this.zone('stop', id);
|
|
1268
|
-
if (!this._active) return Promise.resolve(this._messages.offline);
|
|
1269
1276
|
|
|
1270
1277
|
this.action('stop', id);
|
|
1271
1278
|
const hasOnStop = this.onStop && typeof this.onStop === 'function';
|
|
@@ -1301,9 +1308,10 @@ class Deva {
|
|
|
1301
1308
|
function.
|
|
1302
1309
|
***************/
|
|
1303
1310
|
exit() {
|
|
1311
|
+
if (!this._active) return Promise.resolve(this._messages.offline);
|
|
1304
1312
|
const id = this.uid();
|
|
1313
|
+
this.context('exit', id);
|
|
1305
1314
|
this.zone('exit', id);
|
|
1306
|
-
if (!this._active) return Promise.resolve(this._messages.offline);
|
|
1307
1315
|
|
|
1308
1316
|
this.action('exit', id);
|
|
1309
1317
|
const hasOnExit = this.onExit && typeof this.onExit === 'function';
|
|
@@ -1357,7 +1365,7 @@ class Deva {
|
|
|
1357
1365
|
***************/
|
|
1358
1366
|
state(value=false, extra=false) {
|
|
1359
1367
|
try {
|
|
1360
|
-
if (!value || !this._states[value]
|
|
1368
|
+
if (!value || !this._states[value]) return; // return if no matching value
|
|
1361
1369
|
this._state = value; // set the local state variable.
|
|
1362
1370
|
const lookup = this._states[value]; // set the local states lookup
|
|
1363
1371
|
const text = extra ? `${lookup} ${extra}` : lookup; // set text from lookup with extra
|
|
@@ -1413,7 +1421,7 @@ class Deva {
|
|
|
1413
1421
|
***************/
|
|
1414
1422
|
zone(value=false, extra=false) {
|
|
1415
1423
|
const id = this.uid();
|
|
1416
|
-
if (!value || !this._zones[value]
|
|
1424
|
+
if (!value || !this._zones[value]) return;
|
|
1417
1425
|
|
|
1418
1426
|
try {
|
|
1419
1427
|
this._zone = value;
|
|
@@ -1478,7 +1486,7 @@ class Deva {
|
|
|
1478
1486
|
action(value=false, extra=false) {
|
|
1479
1487
|
const id = this.uid();
|
|
1480
1488
|
try {
|
|
1481
|
-
if (!value || !this._actions[value]
|
|
1489
|
+
if (!value || !this._actions[value]) return;
|
|
1482
1490
|
this._action = value; // set the local action variable
|
|
1483
1491
|
// check local vars for custom actions
|
|
1484
1492
|
const var_action = this.vars.actions ? this.vars.actions[value] : false;
|
|
@@ -1996,13 +2004,13 @@ class Deva {
|
|
|
1996
2004
|
created: Date.now(),
|
|
1997
2005
|
}
|
|
1998
2006
|
|
|
1999
|
-
this.action('hash',
|
|
2007
|
+
this.action('hash', `${key}:${value}:md5:${data.id.uid}`);
|
|
2000
2008
|
data.md5 = this.hash(data); // md5 the data packet
|
|
2001
2009
|
|
|
2002
|
-
this.action('hash',
|
|
2010
|
+
this.action('hash', `${key}:${value}:sha256:${data.id.uid}`);
|
|
2003
2011
|
data.sha256 = this.hash(data, 'sha256'); // sha256 the data packet
|
|
2004
2012
|
|
|
2005
|
-
this.action('hash',
|
|
2013
|
+
this.action('hash', `${key}:${value}:sha512:${data.id.uid}`);
|
|
2006
2014
|
data.sha512 = this.hash(data, 'sha512'); // sha512 the data packet
|
|
2007
2015
|
|
|
2008
2016
|
this.action('talk', `${key}:${value}:${id.uid}`);
|
|
@@ -2230,10 +2238,10 @@ class Deva {
|
|
|
2230
2238
|
const date = this.lib.formatDate(time, 'long', true); // set date to local constant
|
|
2231
2239
|
|
|
2232
2240
|
const core_hash = this.hash(this._core, 'sha256');
|
|
2233
|
-
const machine_hash = this.machine().sha256;
|
|
2234
|
-
|
|
2235
|
-
const client_hash = this.client().sha256 || false;
|
|
2236
|
-
const agent_hash = this.agent().sha256 || false;
|
|
2241
|
+
const machine_hash = this.machine().sha256; // get the machine hash
|
|
2242
|
+
|
|
2243
|
+
const client_hash = this.client().sha256 || false; // get client hash
|
|
2244
|
+
const agent_hash = this.agent().sha256 || false; // get agent hash
|
|
2237
2245
|
|
|
2238
2246
|
const data = {
|
|
2239
2247
|
uid: false,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "25552873878502387963",
|
|
3
3
|
"name": "@indra.ai/deva",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.84",
|
|
5
5
|
"description": "Deva Core a Vedic-inspired Event Based Context Aware Feature, Zone, Action, and State Machine integrated Artificial Intelligence Framework",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"license": "VLA:25552873878502387963 LICENSE.md",
|
package/tests/index.js
CHANGED
|
@@ -92,11 +92,10 @@ const DevaTest = new Deva({
|
|
|
92
92
|
console.log(`π₯ action: ${packet.text}`);
|
|
93
93
|
},
|
|
94
94
|
'devacore:feature'(packet) {
|
|
95
|
-
|
|
96
|
-
console.log(`πΏ feature: ${packet.text}`);
|
|
95
|
+
console.log(`\nπΏ feature: ${packet.text}`);
|
|
97
96
|
},
|
|
98
97
|
'devacore:context'(packet) {
|
|
99
|
-
console.log(
|
|
98
|
+
console.log(`πΉ context: ${packet.text}`);
|
|
100
99
|
},
|
|
101
100
|
'devacore:error'(packet) {
|
|
102
101
|
console.log(`β error: ${packet.text}`);
|
|
@@ -169,30 +168,12 @@ const DevaTest = new Deva({
|
|
|
169
168
|
return test;
|
|
170
169
|
},
|
|
171
170
|
},
|
|
172
|
-
onStart(data, resolve) {
|
|
173
|
-
this.context('start', data.id.uid);
|
|
174
|
-
return this.enter(data, resolve);
|
|
175
|
-
},
|
|
176
|
-
onEnter(data, resolve) {
|
|
177
|
-
this.context('enter', data.id.uid);
|
|
178
|
-
return this.done(data, resolve);
|
|
179
|
-
},
|
|
180
|
-
onDone(data, resolve) {
|
|
181
|
-
this.context('done', data.id.uid);
|
|
182
|
-
return this.ready(data, resolve);
|
|
183
|
-
},
|
|
184
171
|
onReady(data, resolve) {
|
|
185
|
-
this.context('ready', data.id.uid);
|
|
186
172
|
const test = this.methods.test(data);
|
|
187
173
|
this.prompt(test.text);
|
|
188
174
|
return resolve(data);
|
|
189
175
|
},
|
|
190
|
-
onFinish(data, resolve) {
|
|
191
|
-
this.context('finish', data.id.uid);
|
|
192
|
-
return this.complete(data, resolve);
|
|
193
|
-
},
|
|
194
176
|
onComplete(data, resolve) {
|
|
195
|
-
this.context('complete', data.id.uid);
|
|
196
177
|
return resolve(data);
|
|
197
178
|
},
|
|
198
179
|
onError(e) {
|