@indra.ai/deva 1.6.98 → 1.6.99

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.
Files changed (2) hide show
  1. package/index.js +24 -22
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1369,12 +1369,13 @@ class Deva {
1369
1369
  stop() {
1370
1370
  if (!this._active) return this._messages.offline;
1371
1371
  const id = this.uid();
1372
- this.context('stop', id.uid);
1373
- this.zone('stop', id.uid);
1374
- this.action('stop', id.uid);
1375
- this.state('stop', id.uid); // set the state to stop
1372
+ const key = 'stop';
1373
+ this.context(key, id.uid);
1374
+ this.zone(key, id.uid);
1375
+ this.action(key, id.uid);
1376
+ this.state(key, id.uid); // set the state to stop
1376
1377
 
1377
- this.state('set', `stop:agent:${id.uid}`); // state stop agent
1378
+ this.state('set', `${key}:agent:${id.uid}`); // state stop agent
1378
1379
  const agent = this.agent(); // get the current agent
1379
1380
 
1380
1381
  this.state('set', `stop:client:${id.uid}`); // state stop agent
@@ -1383,10 +1384,10 @@ class Deva {
1383
1384
  this.state('data', `stop:${id.uid}`);
1384
1385
  const data = { // build the stop data
1385
1386
  id, // set the id
1386
- key: agent.key, // set the key
1387
- value: 'stop', // set the value
1388
- agent: this.agent(), // set the agent
1389
- client: this.client(), // set the client
1387
+ key, // set the key
1388
+ value: agent.key, // set the value
1389
+ agent: agent.sha256, // set the agent
1390
+ client: client.sha256, // set the client
1390
1391
  stop: Date.now(), // set the created date
1391
1392
  }
1392
1393
 
@@ -1423,27 +1424,28 @@ class Deva {
1423
1424
  ***************/
1424
1425
  exit(data) {
1425
1426
  if (!this._active) return this._messages.offline;
1426
-
1427
- this.context('exit', data.id.uid);
1428
- this.zone('exit', data.id.uid);
1429
- this.action('exit', data.id.uid);
1430
- this.state('exit', data.id.uid); // set the state to stop
1431
-
1432
- this.action('delete', `stop:md5:${data.id.uid}`);
1427
+ data.key_prev = data.key;
1428
+ data.key = 'exit';
1429
+ this.context(data.key, data.id.uid);
1430
+ this.zone(data.key, data.id.uid);
1431
+ this.action(data.key, data.id.uid);
1432
+ this.state(data.key, data.id.uid); // set the state to stop
1433
+
1434
+ this.action('delete', `${data.key_prev}:md5:${data.id.uid}`);
1433
1435
  delete data.md5;
1434
- this.action('delete', `stop:sha256:${data.id.uid}`);
1436
+ this.action('delete', `${data.key_prev}:sha256:${data.id.uid}`);
1435
1437
  delete data.sha256;
1436
- this.action('delete', `stop:sha512:${data.id.uid}`);
1438
+ this.action('delete', `${data.key_prev}:sha512:${data.id.uid}`);
1437
1439
  delete data.sha512;
1438
1440
 
1439
- this.state('set', `exit:time:${data.id.uid}`); // state stop agent
1441
+ this.state('set', `${data.key}:time:${data.id.uid}`); // state stop agent
1440
1442
  data.exit = Date.now();
1441
1443
 
1442
- this.action('hash', `stop:md5:${data.id.uid}`);
1444
+ this.action('hash', `${data.key}:md5:${data.id.uid}`);
1443
1445
  data.md5 = this.hash(data, 'md5');
1444
- this.action('hash', `stop:sha256:${data.id.uid}`)
1446
+ this.action('hash', `${data.key}:sha256:${data.id.uid}`)
1445
1447
  data.sha256 = this.hash(data, 'sha256');
1446
- this.action('hash', `stop:sha512:${data.id.uid}`)
1448
+ this.action('hash', `${data.key}:sha512:${data.id.uid}`)
1447
1449
  data.sha512 = this.hash(data, 'sha512');
1448
1450
 
1449
1451
  // clear memory
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "44091450722329207445",
3
3
  "name": "@indra.ai/deva",
4
- "version": "1.6.98",
4
+ "version": "1.6.99",
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",