@indra.ai/deva 1.8.3 → 1.8.5

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.
@@ -13,10 +13,14 @@
13
13
  "finish": "devacore:finish",
14
14
  "complete": "devacore:complete",
15
15
  "stop": "devacore:stop",
16
+ "close": "devacore:leave",
17
+ "leave": "devacore:leave",
16
18
  "exit": "devacore:exit",
19
+ "shutdown": "devacore:shutdown",
17
20
  "question": "devacore:question",
18
21
  "answer": "devacore:answer",
19
22
  "ask": "devacore:ask",
23
+ "context": "devacore:context",
20
24
  "feature": "devacore:feature",
21
25
  "zone": "devacore:zone",
22
26
  "action": "devacore:action",
@@ -24,7 +28,6 @@
24
28
  "intent": "devacore:intent",
25
29
  "belief": "devacore:belief",
26
30
  "load": "devacore:load",
27
- "unload": "devacore:unload",
28
- "context": "devacore:context"
31
+ "unload": "devacore:unload"
29
32
  }
30
33
  }
package/config/index.js CHANGED
@@ -96,10 +96,9 @@ export default {
96
96
  },
97
97
  exit: {
98
98
  prev_key: 'stop',
99
- next_key: false,
99
+ next_key: 'shutdown',
100
100
  onfunc: 'onExit',
101
101
  clear: [
102
- '_active',
103
102
  '_indra',
104
103
  '_veda',
105
104
  '_license',
@@ -123,6 +122,18 @@ export default {
123
122
  '_systems',
124
123
  '_networks',
125
124
  ]
125
+ },
126
+ shutdown: {
127
+ prev_key: 'exit',
128
+ next_key: false,
129
+ onfunc: 'onShutdown',
130
+ clear: [
131
+ 'modules',
132
+ 'listeners',
133
+ 'events',
134
+ '_config',
135
+ '_active',
136
+ ],
126
137
  }
127
138
  },
128
139
  context: false,
package/config/zones.json CHANGED
@@ -64,10 +64,10 @@
64
64
  "crisis": "😱 Crisis",
65
65
  "private": "🤫 Private",
66
66
  "public": "😀 Public",
67
+ "industry": "🏭 Industry",
67
68
  "merit": "➕ Merit",
68
69
  "demerit": "➖ Demerit",
69
70
  "camera": "🤳 Camera",
70
- "victim": "❤️‍🩹 Victim",
71
71
  "yakshas": "🥩 Yakshas",
72
72
  "rakshasas": "🥩 Rakshasas",
73
73
  "pisakas": "🥩 Pisakas",
@@ -77,6 +77,15 @@
77
77
  "porn": "👙 Pornography",
78
78
  "prostitute": "💃 Prostitute",
79
79
  "friend": "🤝 Friend",
80
- "enemy": "🚨 Enemy"
80
+ "enemy": "🚨👿 Enemy",
81
+ "suspect": "🚨🥸 Suspect",
82
+ "culprit": "🚨😤 Culprit",
83
+ "criminal": "🚨🤬 Criminal",
84
+ "felon": "🚨🙅 Felon",
85
+ "victim": "🚨🩼 Victim",
86
+ "hostage": "🚨🙊 Hostage",
87
+ "court": "🏛️🧑‍⚖️ Court",
88
+ "jail": "⛓️🔏 Jail",
89
+ "prison": "⛓️🔐 Prison"
81
90
  }
82
91
  }
package/index.js CHANGED
@@ -1363,18 +1363,18 @@ class Deva {
1363
1363
 
1364
1364
  /**************
1365
1365
  func: stop
1366
- params:
1367
- - msg: hte message from the caller incase need to use in calls
1368
- describe:
1369
- The stop function will stop the Deva by setting necessary context,
1370
- zone, action, state to stop and creating the stop data packet.
1371
- usage:
1372
- this.stop()
1366
+ usage: this.stop(data, resolve);
1367
+ params: data, resolve
1368
+ - data: The data packet that is passed through the closing invoke chain.
1369
+ - resolve: The Promise resolver following the data through recursion.
1370
+ describe:
1371
+ The stop() function initiates the egress stop aspect of the Invoke
1372
+ Recursion Framework.
1373
1373
  ***************/
1374
1374
  stop() {
1375
- if (!this._active) return this._messages.offline;
1376
- const key = 'stop';
1377
- const id = this.uid();
1375
+ if (!this._active) return this._messages.offline; // check for active status
1376
+ const key = 'stop'; // set the stop key
1377
+ const id = this.uid(); // generate the stop uid
1378
1378
 
1379
1379
  this.state('set', `${key}:agent:${id.uid}`); // state stop agent
1380
1380
  const agent = this.agent().sha256; // get the current agent
@@ -1393,6 +1393,9 @@ class Deva {
1393
1393
  stop: Date.now(), // set the created date
1394
1394
  }
1395
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}`);
1396
1399
  return this._invoke({
1397
1400
  key,
1398
1401
  data,
@@ -1407,11 +1410,7 @@ class Deva {
1407
1410
  - data: The data packet that is passed through the closing invoke chain.
1408
1411
  - resolve: The Promise resolver following the data through recursion.
1409
1412
  describe:
1410
- The close() function initiates the closing Invoke Recursion Framework.
1411
- It first checks for active runtime status, retrieves invocation parameters
1412
- (chain mapping, lifecycle handlers) from config.invoke.close and then
1413
- delegates control to _invoke(), ensuring consistent recursion through the
1414
- start-enter-done sequence.
1413
+ The close() function initiates the close aspect of the Invoke Recursion Framework.
1415
1414
  ***************/
1416
1415
  close(data, resolve) {
1417
1416
  if (!this._active) return resolve(this._messages.offline);
@@ -1426,10 +1425,7 @@ class Deva {
1426
1425
  - resolve: The Promise resolver following the data through recursion.
1427
1426
  describe:
1428
1427
  The leave() function initiates the leave aspect of the Invoke Recursion
1429
- Framework. It first checks for active runtime status, retrieves invocation
1430
- parameters (chain mapping, lifecycle handlers) from config.invoke.close and
1431
- then delegates control to _invoke(), ensuring consistent recursion through
1432
- the start-enter-done sequence.
1428
+ Framework.
1433
1429
  ***************/
1434
1430
  leave(data, resolve) {
1435
1431
  if (!this._active) return resolve(this._messages.offline);
@@ -1438,6 +1434,23 @@ class Deva {
1438
1434
 
1439
1435
  /**************
1440
1436
  func: exit
1437
+ usage: this.exit(data, resolve);
1438
+ params: data, resolve
1439
+ - data: The data packet that is passed through the egress invoke chain.
1440
+ - resolve: The Promise resolver following the data through recursion.
1441
+ describe:
1442
+ The exit() function initiates the exit aspect of the Invoke Recursion
1443
+ Framework.
1444
+ ***************/
1445
+ exit(data, resolve) {
1446
+ if (!this._active) return this._messages.offline;
1447
+ const key = 'exit';
1448
+ data.key = key;
1449
+ return this._invoke({key, data, resolve})
1450
+ }
1451
+
1452
+ /**************
1453
+ func: shutdown
1441
1454
  params:
1442
1455
  - msg: hte message from the caller incase need to use in calls
1443
1456
  describe:
@@ -1446,9 +1459,9 @@ class Deva {
1446
1459
  The return will check for a custom onExit function or run the done
1447
1460
  function.
1448
1461
  ***************/
1449
- exit(data, resolve) {
1462
+ shutdown(data, resolve) {
1450
1463
  if (!this._active) return this._messages.offline;
1451
- const key = 'exit';
1464
+ const key = 'shutdown';
1452
1465
  data.key = key;
1453
1466
  return this._invoke({key, data, resolve})
1454
1467
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "44091450722329207445",
3
3
  "name": "@indra.ai/deva",
4
- "version": "1.8.3",
4
+ "version": "1.8.5",
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",