@indra.ai/deva 1.8.5 β†’ 1.8.7

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.
@@ -45,7 +45,10 @@
45
45
  "enter": "πŸšͺ Enter",
46
46
  "finish": "🏁 Finish",
47
47
  "stop": "πŸ”΄ Stop",
48
+ "close": "πŸ“¦ Close",
49
+ "leave": "🫣 Leave",
48
50
  "exit": "πŸšͺ Exit",
51
+ "shutdown": "πŸ”Œ Shutdown",
49
52
  "method": "❀️‍πŸ”₯ Method",
50
53
  "func": "πŸ”¦ Func",
51
54
  "onfunc": "🎚️ onFunction",
@@ -34,6 +34,7 @@
34
34
  "delusional": "πŸͺ© Delusional",
35
35
  "pervert": "πŸ’‹ Pervert",
36
36
  "romance": "🌹 Romance",
37
- "other": "πŸ€” Other"
37
+ "other": "πŸ€” Other",
38
+ "belief": "πŸ” Security"
38
39
  }
39
40
  }
package/config/index.js CHANGED
@@ -91,7 +91,7 @@ export default {
91
91
  leave: {
92
92
  prev_key: 'close',
93
93
  next_key: 'exit',
94
- onfunc: 'onClose',
94
+ onfunc: 'onLeave',
95
95
  clear: false,
96
96
  },
97
97
  exit: {
@@ -45,6 +45,9 @@
45
45
  "finish": "🏁 Finish",
46
46
  "complete": "βœ… Complete",
47
47
  "stop": "πŸ”΄ Stop",
48
- "exit": "πŸšͺ Exit"
48
+ "close": "πŸ“¦ Close",
49
+ "leave": "🫣 Leave",
50
+ "exit": "πŸšͺ Exit",
51
+ "shutdown": "πŸ”Œ Shutdown"
49
52
  }
50
53
  }
@@ -31,9 +31,11 @@
31
31
  "finish": "🏁 Finish",
32
32
  "complete": "βœ… Complete",
33
33
  "stop": "πŸ”΄ Stop",
34
+ "close": "πŸ“¦ Close",
35
+ "leave": "🫣 Leave",
34
36
  "exit": "πŸšͺ Exit",
37
+ "shutdown": "πŸ”Œ Shutdown",
35
38
  "open": "πŸ₯« Open",
36
- "close": "πŸ“¦ Close",
37
39
  "begin": "πŸ—ΊοΈ Begin",
38
40
  "end": "🎬 End",
39
41
  "load": "πŸ“¦ Load",
package/config/zones.json CHANGED
@@ -22,8 +22,11 @@
22
22
  "init": "🟠 Init",
23
23
  "start": "🟒 Start",
24
24
  "stop": "πŸ”΄ Stop",
25
- "enter": "πŸšͺ Enter",
25
+ "close": "πŸ“¦ Close",
26
+ "leave": "🫣 Leave",
26
27
  "exit": "πŸšͺ Exit",
28
+ "shutdown": "πŸ”Œ Shutdown",
29
+ "enter": "βŽ† Enter",
27
30
  "finish": "🏁 Finish",
28
31
  "complete": "βœ… Complete",
29
32
  "done": "β˜‘οΈ Done",
package/index.js CHANGED
@@ -1375,32 +1375,39 @@ class Deva {
1375
1375
  if (!this._active) return this._messages.offline; // check for active status
1376
1376
  const key = 'stop'; // set the stop key
1377
1377
  const id = this.uid(); // generate the stop uid
1378
-
1379
- this.state('set', `${key}:agent:${id.uid}`); // state stop agent
1380
- const agent = this.agent().sha256; // get the current agent
1381
- const value = agent.key;
1382
-
1383
- this.state('set', `${key}:client:${id.uid}`); // state stop agent
1384
- const client = this.client().sha256; // set the current client
1385
-
1386
- this.state('data', `${key}:${id.uid}`);
1387
- const data = { // build the stop data
1388
- id, // set the id
1389
- key, // set the key
1390
- value, // set the value
1391
- agent, // set the agent
1392
- client, // set the client
1393
- stop: Date.now(), // set the created date
1394
- }
1395
-
1396
- this.action('return', `${key}:invoke:${data.id.uid}`);
1397
- this.state('valid', `${key}:invoke:${data.id.uid}`);
1398
- this.intent('good', `${key}:invoke:${data.id.uid}`);
1399
- return this._invoke({
1400
- key,
1401
- data,
1402
- resolve: Promise.resolve(),
1403
- })
1378
+ let data;
1379
+ return new Promise((resolve, reject) => {
1380
+ try {
1381
+ this.state('set', `${key}:agent:${id.uid}`); // state stop agent
1382
+ const agent = this.agent().sha256; // get the current agent
1383
+ const value = agent.key;
1384
+
1385
+ this.state('set', `${key}:client:${id.uid}`); // state stop agent
1386
+ const client = this.client().sha256; // set the current client
1387
+
1388
+ this.state('data', `${key}:${id.uid}`);
1389
+ data = { // build the stop data
1390
+ id, // set the id
1391
+ key, // set the key
1392
+ value, // set the value
1393
+ agent, // set the agent
1394
+ client, // set the client
1395
+ stop: Date.now(), // set the created date
1396
+ }
1397
+
1398
+ this.action('return', `${key}:invoke:${data.id.uid}`);
1399
+ this.state('valid', `${key}:invoke:${data.id.uid}`);
1400
+ this.intent('good', `${key}:invoke:${data.id.uid}`);
1401
+ return this._invoke({
1402
+ key,
1403
+ data,
1404
+ resolve,
1405
+ });
1406
+ }
1407
+ catch (err) {
1408
+ return this.err(err, data, reject);
1409
+ }
1410
+ });
1404
1411
  }
1405
1412
 
1406
1413
  /**************
@@ -1414,7 +1421,9 @@ class Deva {
1414
1421
  ***************/
1415
1422
  close(data, resolve) {
1416
1423
  if (!this._active) return resolve(this._messages.offline);
1417
- return this._invoke({key:'close',data,resolve});
1424
+ const key = 'close';
1425
+ data.key = key;
1426
+ return this._invoke({key,data,resolve});
1418
1427
  }
1419
1428
 
1420
1429
  /**************
@@ -1429,7 +1438,9 @@ class Deva {
1429
1438
  ***************/
1430
1439
  leave(data, resolve) {
1431
1440
  if (!this._active) return resolve(this._messages.offline);
1432
- return this._invoke({key:'leave',data,resolve});
1441
+ const key = 'leave';
1442
+ data.key = key;
1443
+ return this._invoke({key,data,resolve});
1433
1444
  }
1434
1445
 
1435
1446
  /**************
@@ -1443,10 +1454,10 @@ class Deva {
1443
1454
  Framework.
1444
1455
  ***************/
1445
1456
  exit(data, resolve) {
1446
- if (!this._active) return this._messages.offline;
1457
+ if (!this._active) return resolve(this._messages.offline);
1447
1458
  const key = 'exit';
1448
1459
  data.key = key;
1449
- return this._invoke({key, data, resolve})
1460
+ return this._invoke({key,data,resolve});
1450
1461
  }
1451
1462
 
1452
1463
  /**************
@@ -1460,7 +1471,7 @@ class Deva {
1460
1471
  function.
1461
1472
  ***************/
1462
1473
  shutdown(data, resolve) {
1463
- if (!this._active) return this._messages.offline;
1474
+ if (!this._active) return resolve(this._messages.offline);
1464
1475
  const key = 'shutdown';
1465
1476
  data.key = key;
1466
1477
  return this._invoke({key, data, resolve})
@@ -2035,7 +2046,7 @@ class Deva {
2035
2046
  } catch (e) {
2036
2047
  this.state('catch', `unload:${key}`);
2037
2048
  this.intent('bad', `unload:${key}`);
2038
- return this.err(e, this.devas[key], reject)
2049
+ return this.err(e, key, reject)
2039
2050
  }
2040
2051
  });
2041
2052
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "44091450722329207445",
3
3
  "name": "@indra.ai/deva",
4
- "version": "1.8.5",
4
+ "version": "1.8.7",
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:44091450722329207445 LICENSE.md",