@indra.ai/deva 1.62.75 โ†’ 1.62.77

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.
@@ -41,7 +41,6 @@
41
41
  "shutdown": "๐Ÿ”Œ Shutdown",
42
42
  "method": "โค๏ธโ€๐Ÿ”ฅ Method",
43
43
  "func": "๐Ÿ”ฆ Func",
44
- "onfunc": "๐ŸŽš๏ธ onFunction",
45
44
  "actions": "๐ŸŽ๏ธ Actions",
46
45
  "feature": "๐ŸŽฅ Feature",
47
46
  "features": "๐ŸŽฅ Features",
package/_data/msgs.json CHANGED
@@ -19,13 +19,16 @@
19
19
  "nokey": "โ›”๏ธ NO KEY PROVIDED",
20
20
  "invalidkey": "โ›”๏ธ INVALID KEY PROVIDED",
21
21
  "matchkey": "โ›”๏ธ INVALID KEY MATCH",
22
- "invalidfeature": "โ›”๏ธ INVALID feature",
22
+ "invalidfeature": "โ›”๏ธ INVALID FEATURE",
23
23
  "asktimeout": "โ›”๏ธ ASK TIMEOUT",
24
24
  "noask": "โ›”๏ธ ASK TARGET NOT FOUND",
25
25
  "method_not_found": "โ›”๏ธ METHOD NOT FOUND",
26
26
  "help_not_found": "โ›”๏ธ HELP NOT FOUND",
27
27
  "invalid_agent": "โ›”๏ธ Agent Hash Invalid",
28
28
  "invalid_client": "โ›”๏ธ Client Hash Invalid",
29
+ "personalVLA": "โŒ Bad Personal VLA",
30
+ "packageVLA": "โŒ Bad Package VLA",
31
+ "checkVLA": "โŒ Invalid VLA Check",
29
32
  "load": "๐Ÿ“ฆ Load",
30
33
  "unload": "๐Ÿฅก Unload",
31
34
  "warning": "{{prompt.emoji}} {{profile.name}} declares UNLAWFUL USE, MODIFICATION, INSTALLATION, DUPLICATION, DISTRIBUTION, INTERACTION, or IMPLEMENTATION constitutes VEDIC SAHASA a CRIME of the HIGHEST DEGREE. A FINE amounting to 1000 PANAS (1 pana = 3.5 grams of gold) for each INSTANCE has been ORDAINED the PUNISHMENT for SAHASA of the HIGHEST DEGREE.",
package/_data/states.json CHANGED
@@ -66,7 +66,7 @@
66
66
  "help": "๐Ÿ’™ Help",
67
67
  "authorized": "๐Ÿ”‘ Authorized",
68
68
  "unauthorized": "๐Ÿด Unauthorized",
69
- "Done": "โ˜‘๏ธ Done",
69
+ "Done": "โ˜‘๏ธ Done",
70
70
  "official": "๐Ÿซก Official",
71
71
  "unofficial": "๐Ÿคฅ Unofficial",
72
72
  "approved": "๐ŸŽ–๏ธ Approved",
@@ -95,6 +95,7 @@
95
95
  "incorrect": "๐ŸŸฅ Incorrect",
96
96
  "clean": "๐Ÿงผ Clean",
97
97
  "dirty": "๐Ÿงน Dirty",
98
- "consent": "โœ๏ธ Consent"
98
+ "consent": "โœ๏ธ Consent",
99
+ "check": "โ˜‘๏ธ Check"
99
100
  }
100
101
  }
package/index.js CHANGED
@@ -352,7 +352,7 @@ class Deva {
352
352
 
353
353
  const data_stamped = this._stamp(this._unstamp(data), key, data.id.uid);
354
354
 
355
- // setup the complete talk event
355
+ // setup the complete talk veent
356
356
  this.action('talk', `${this._events[key]}:${data.id.uid}`); // action talk for the event.
357
357
  this.talk(this._events[key], this.lib.copy(data)); // talk the complete event
358
358
 
@@ -367,11 +367,9 @@ class Deva {
367
367
  // determine if there is an onComplete function for the entity.
368
368
  const hasOnFunc = this[onfunc] && typeof this[onfunc] === 'function';
369
369
  if (hasOnFunc) {
370
- this.action('onfunc', `${key}:has:${onfunc}:${data.id.uid}`); // action onfunc
371
- this.state('onfunc', `${key}:has:${onfunc}:${data.id.uid}`); // state onfunc
372
- this.action('return', `${onfunc}:${data.id.uid}`); // action return
373
- this.state('valid', `${onfunc}:${data.id.uid}`); // state valid
374
- this.intent('good', `${onfunc}:${data.id.uid}`); // intent good
370
+ this.action('return', `onfunc:${onfunc}:${data.id.uid}`); // action return
371
+ this.state('valid', `onfunc:${onfunc}:${data.id.uid}`); // state valid
372
+ this.intent('good', `onfunc:${onfunc}:${data.id.uid}`); // intent good
375
373
  return this[onfunc](data, resolve);
376
374
  }
377
375
 
@@ -2230,34 +2228,41 @@ class Deva {
2230
2228
  license_check(personalVLA=false, packageVLA=false) {
2231
2229
  const id = this.uid();
2232
2230
 
2233
- if (!personalVLA) {
2234
- this.intent('bad', `personalVLA:${id.uid}`);
2235
- return false
2231
+ // check the personal VLA is passed
2232
+ if (!personalVLA?.id) {
2233
+ const personalVLA_str = `license_check:personalVLA:${id.uid}`;
2234
+ this.action('return', personalVLA_str); // set the action to return
2235
+ this.state('invalid', personalVLA_str); // set the state to invalid
2236
+ this.intent('bad', personalVLA_str); // set the intent to bad
2237
+ return this._messages.personalVLA; // return the invalid personal VLA message
2236
2238
  };
2237
- this.state('license', `check:personalVLA:${personalVLA.uid}`);
2238
2239
 
2239
- if (!packageVLA) {
2240
- this.intent('bad', `packageVLA:${id.uid}`);
2241
- return false;
2240
+ // check the package VLA is passed.
2241
+ if (!packageVLA?.id) {
2242
+ const packageVLA_str = `license_check:packageVLA:${id.uid}`;
2243
+ this.action('return', packageVLA_str); // set the action to return
2244
+ this.state('invalid', packageVLA_str); // set the state to invalid
2245
+ this.intent('bad', packageVLA_str); // set the intent to bad
2246
+ return this._messages.packageVLA; // return the invalid package VLA message
2242
2247
  }
2243
- this.state('license', `check:packageVLA:${packageVLA.uid}`);
2244
-
2248
+
2245
2249
  // this is to ensure no additional information is being transmitted.
2246
- this.state('license', `compare:sha256:${packageVLA.uid}`);
2247
- const personalVLA_hash = this.hash(personalVLA, 'sha256');
2248
- const packageVLA_hash = this.hash(packageVLA, 'sha256');
2249
-
2250
- if (personalVLA_hash !== packageVLA_hash) return false;
2250
+ this.state('check', `license_check:compare:${packageVLA.uid}`);
2251
+ const personalVLA_hash = this.hash(personalVLA, 'sha256'); // hash the entire personal VLA locally
2252
+ const packageVLA_hash = this.hash(packageVLA, 'sha256'); // hash the entire package VLA locally
2253
+ if (personalVLA_hash !== packageVLA_hash) return this._messages.checkVLA; // if invalid return the invalid message
2251
2254
 
2255
+ this.state('approved', `license_check:${packageVLA.uid}`);
2252
2256
  const approved = {
2253
- id: this.uid(),
2257
+ id,
2254
2258
  time: Date.now(),
2255
2259
  personal: personalVLA_hash,
2256
2260
  package: packageVLA_hash,
2257
2261
  };
2258
2262
 
2259
- this.state('return', `license:${packageVLA.uid}`);
2260
- this.intent('good', `license:${packageVLA.uid}`);
2263
+ this.action('return', `license_check:${packageVLA.uid}`); // set action to return
2264
+ this.state('valid', `license_check:${packageVLA.uid}`); // set the state to valid
2265
+ this.intent('good', `license_check:${packageVLA.uid}`); // set the intent to good
2261
2266
  return this._stamp(approved, 'license_check', packageVLA.uid);
2262
2267
  }
2263
2268
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "23221940810208468106",
3
3
  "name": "@indra.ai/deva",
4
- "version": "1.62.75",
4
+ "version": "1.62.77",
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:23221940810208468106 LICENSE.md",