@indra.ai/deva 1.17.0 → 1.17.2
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/msgs.json +1 -1
- package/index.js +20 -12
- package/package.json +1 -1
- package/tests/agent.json +3 -1
package/config/msgs.json
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"invalid_client": "⛔️ Client Hash Invalid",
|
|
22
22
|
"load": "📦 Load",
|
|
23
23
|
"unload": "🥡 Unload",
|
|
24
|
-
"
|
|
24
|
+
"warning": "⚠️ Unlawful use or duplication of this uid constitutes Vedic Sâhasa/Theft/Crime of the highest degree where a fine amounting to a thousand Panas (1 pana = 3.5 grams of gold) for each occurance is owed and confiscation of the entire property forfeit to Quinn A Michaels is declared to be the punishment for Sâhasa of the highest degree under Vedic Religious Law.",
|
|
25
25
|
"client_license_check": "🪪 Check Client License",
|
|
26
26
|
"client_license_invalid": "❌ The Provided Client License Is Invalid"
|
|
27
27
|
}
|
package/index.js
CHANGED
|
@@ -2360,13 +2360,13 @@ class Deva {
|
|
|
2360
2360
|
uid(guid=false) {
|
|
2361
2361
|
const time = Date.now(); // set time to local constant
|
|
2362
2362
|
const date = this.lib.formatDate(time, 'long', true); // set date to local constant
|
|
2363
|
-
|
|
2363
|
+
const { profile } = this.agent();
|
|
2364
2364
|
const core_hash = this.hash(this._core, 'sha256');
|
|
2365
2365
|
const machine_hash = this.machine().sha256; // get the machine hash
|
|
2366
2366
|
|
|
2367
|
-
const client_hash = this.client().sha256
|
|
2368
|
-
const agent_hash = this.agent().sha256
|
|
2369
|
-
const warning = this._agent.profile.
|
|
2367
|
+
const client_hash = this.client().sha256; // get client hash
|
|
2368
|
+
const agent_hash = this.agent().sha256; // get agent hash
|
|
2369
|
+
const warning = this._agent.profile.warning || this._messages.warning; // agent or default warning
|
|
2370
2370
|
const copyright = this._agent.profile.copyright || this._core.copyright; // agent or default warning
|
|
2371
2371
|
|
|
2372
2372
|
const fingerprint_data = {
|
|
@@ -2420,10 +2420,10 @@ class Deva {
|
|
|
2420
2420
|
***************/
|
|
2421
2421
|
sign(packet) {
|
|
2422
2422
|
const time = Date.now();
|
|
2423
|
+
const id = this.uid();
|
|
2423
2424
|
const client = this.client();
|
|
2424
2425
|
const agent = this.agent();
|
|
2425
|
-
const {q
|
|
2426
|
-
const transport = id.uid; // set the transport id from the packet id.
|
|
2426
|
+
const {q} = packet;
|
|
2427
2427
|
|
|
2428
2428
|
const {meta, text} = q;
|
|
2429
2429
|
const {key, method, params} = meta;
|
|
@@ -2436,10 +2436,10 @@ class Deva {
|
|
|
2436
2436
|
const client_hash = client.sha256 === packet.q.client.sha256 ? client.sha256 : invalid_client;
|
|
2437
2437
|
const created = this.lib.formatDate(time, 'long', true); // Formatted created date.
|
|
2438
2438
|
|
|
2439
|
-
const container = `OM:O:${key.toUpperCase()}:${
|
|
2439
|
+
const container = `OM:O:${key.toUpperCase()}:${id.uid}`; // set container string.
|
|
2440
2440
|
|
|
2441
2441
|
const packet_hash = this.hash(packet, 'sha256');
|
|
2442
|
-
const token = this.hash(`${key} client:${client.profile.id} fullname:${client.profile.fullname}
|
|
2442
|
+
const token = this.hash(`${key} client:${client.profile.id} fullname:${client.profile.fullname} uid:${id.uid}`, 'sha256');
|
|
2443
2443
|
|
|
2444
2444
|
// build the main data packet.
|
|
2445
2445
|
const data = {
|
|
@@ -2456,7 +2456,7 @@ class Deva {
|
|
|
2456
2456
|
fullname: client.profile.fullname,
|
|
2457
2457
|
emojis: client.profile.emojis,
|
|
2458
2458
|
company: client.profile.company,
|
|
2459
|
-
expires: client.expires ? time + client.expires : 'none',
|
|
2459
|
+
expires: client.profile.expires ? time + client.profile.expires : 'none',
|
|
2460
2460
|
caseid: client.profile.caseid || 'none',
|
|
2461
2461
|
token,
|
|
2462
2462
|
sha256: client.sha256,
|
|
@@ -2468,13 +2468,21 @@ class Deva {
|
|
|
2468
2468
|
},
|
|
2469
2469
|
packet: packet_hash,
|
|
2470
2470
|
created,
|
|
2471
|
-
warning:
|
|
2472
|
-
copyright:
|
|
2471
|
+
warning: agent.profile.warning || 'none',
|
|
2472
|
+
copyright: agent.profile.copyright || this._core.copyright,
|
|
2473
2473
|
};
|
|
2474
|
+
|
|
2475
|
+
this.action('hash', `${data.key}:sign:md5:${data.id.uid}`);
|
|
2474
2476
|
data.md5 = this.hash(data, 'md5'); // hash data packet into md5 and inert into data.
|
|
2477
|
+
|
|
2478
|
+
this.action('hash', `${data.key}:sign:sha256:${data.id.uid}`);
|
|
2475
2479
|
data.sha256 = this.hash(data, 'sha256'); // hash data into sha 256 then set in data.
|
|
2480
|
+
|
|
2481
|
+
this.action('hash', `${data.key}:sign:sha512:${data.id.uid}`);
|
|
2476
2482
|
data.sha512 = this.hash(data, 'sha512'); // hash data into sha 512 then set in data.
|
|
2477
|
-
|
|
2483
|
+
|
|
2484
|
+
this.action('return', `${data.key}:sign:${data.id.uid}`);
|
|
2485
|
+
this.intent('good', `${data.key}:sign:${data.id.uid}`);
|
|
2478
2486
|
return data;
|
|
2479
2487
|
}
|
|
2480
2488
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "44091450722329207445",
|
|
3
3
|
"name": "@indra.ai/deva",
|
|
4
|
-
"version": "1.17.
|
|
4
|
+
"version": "1.17.2",
|
|
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",
|
package/tests/agent.json
CHANGED
|
@@ -41,7 +41,9 @@
|
|
|
41
41
|
"emoji": "/public/devas/deva/emoji.png",
|
|
42
42
|
"avatar": "/public/devas/deva/avatar.png",
|
|
43
43
|
"background": "/public/devas/deva/background.png",
|
|
44
|
-
"gender": "M"
|
|
44
|
+
"gender": "M",
|
|
45
|
+
"warning": false,
|
|
46
|
+
"copyright": false
|
|
45
47
|
},
|
|
46
48
|
"vars": {
|
|
47
49
|
"hello": "Hello World",
|