@indra.ai/deva 1.5.43 โ†’ 1.5.45

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/index.js CHANGED
@@ -17,15 +17,19 @@ class Deva {
17
17
  this._agent = opts.agent || false; // Agent profile object
18
18
  this._client = {}; // this will be set on init.
19
19
  this._active = false; // the active/birth date.
20
+ this._vector = false; // inherited Vector features.
20
21
  this._security = false; // inherited Security features.
22
+ this._guard = false; // inherited Guard features.
21
23
  this._defense = false; // inherited Security features.
24
+ this._wall = false; // inherited Wall features.
25
+ this._proxy = false; // inherited Proxy features.
26
+ this._legal = false; // inherited Legal features.
27
+ this._authority = false; // inherited Justice features.
28
+ this._justice = false; // inherited Justice features.
22
29
  this._support = false; // inherited Support features.
23
30
  this._services = false; // inherited Service features.
24
31
  this._systems = false; // inherited Systems features.
25
32
  this._networks = false; // inherited Systems features.
26
- this._legal = false; // inherited Legal features.
27
- this._justice = false; // inherited Justice features.
28
- this._authority = false; // inherited Justice features.
29
33
  this.events = opts.events || new EventEmitter({}); // Event Bus
30
34
  this.lib = new lib({}); // used for loading library functions
31
35
  this.utils = opts.utils || {}; // parse function
@@ -266,6 +270,7 @@ class Deva {
266
270
  concerns: data.concerns, // any concerns for client
267
271
  global: data.global, // the global policies for client
268
272
  personal: data.devas[this._agent.key], // Client personal features and rules.
273
+ created: Date.now(),
269
274
  };
270
275
  delete this._client.features[feature]; // make a copy the clinet data.
271
276
  this.state('resolve', `${feature}:${_id}`);
@@ -277,6 +282,17 @@ class Deva {
277
282
  }
278
283
  }
279
284
 
285
+ /**************
286
+ func: Vector
287
+ params: client: false
288
+ describe:
289
+ The Vector feature sets the correct variables and necessary rules for the
290
+ client presented data.
291
+ ***************/
292
+ Vector(resolve, reject) {
293
+ return this.Feature('vector', resolve, reject);
294
+ }
295
+
280
296
  /**************
281
297
  func: Security
282
298
  params: client: false
@@ -311,47 +327,36 @@ class Deva {
311
327
  }
312
328
 
313
329
  /**************
314
- func: Support
330
+ func: Wall
315
331
  params: client: false
316
332
  describe:
317
- The Support feature sets the correct variables and necessary rules for the
333
+ The Defense feature sets the correct variables and necessary rules for the
318
334
  client presented data.
319
335
  ***************/
320
- Support(resolve, reject) {
321
- return this.Feature('support', resolve, reject);
336
+ Wall(resolve, reject) {
337
+ return this.Feature('wall', resolve, reject);
322
338
  }
323
339
 
324
340
  /**************
325
- func: Services
341
+ func: Shield
326
342
  params: client: false
327
343
  describe:
328
- The Services feature sets the correct variables and necessary rules for the
344
+ The Shield feature sets the correct variables and necessary rules for the
329
345
  client presented data.
330
346
  ***************/
331
- Services(resolve, reject) {
332
- return this.Feature('services', resolve, reject);
347
+ Shield(resolve, reject) {
348
+ return this.Feature('shield', resolve, reject);
333
349
  }
334
350
 
335
351
  /**************
336
- func: Systems
352
+ func: Proxy
337
353
  params: client: false
338
354
  describe:
339
- The Systems feature sets the correct variables and necessary rules for the
340
- client presented data.
341
- ***************/
342
- Systems(resolve, reject) {
343
- return this.Feature('systems', resolve, reject);
344
- }
345
-
346
- /**************
347
- func: Networks
348
- params: resolve, reject
349
- describe:
350
- The Networks feature sets the correct variables and necessary rules for the
355
+ The Defense feature sets the correct variables and necessary rules for the
351
356
  client presented data.
352
357
  ***************/
353
- Networks(resolve, reject) {
354
- return this.Feature('networks', resolve, reject);
358
+ Proxy(resolve, reject) {
359
+ return this.Feature('proxy', resolve, reject);
355
360
  }
356
361
 
357
362
  /**************
@@ -364,7 +369,7 @@ class Deva {
364
369
  Legal(resolve, reject) {
365
370
  return this.Feature('legal', resolve, reject);
366
371
  }
367
-
372
+
368
373
  /**************
369
374
  func: Justice
370
375
  params: client: false
@@ -375,7 +380,7 @@ class Deva {
375
380
  Justice(resolve, reject) {
376
381
  return this.Feature('justice', resolve, reject);
377
382
  }
378
-
383
+
379
384
  /**************
380
385
  func: Authority
381
386
  params: client: false
@@ -387,6 +392,50 @@ class Deva {
387
392
  return this.Feature('authority', resolve, reject);
388
393
  }
389
394
 
395
+ /**************
396
+ func: Support
397
+ params: client: false
398
+ describe:
399
+ The Support feature sets the correct variables and necessary rules for the
400
+ client presented data.
401
+ ***************/
402
+ Support(resolve, reject) {
403
+ return this.Feature('support', resolve, reject);
404
+ }
405
+
406
+ /**************
407
+ func: Services
408
+ params: client: false
409
+ describe:
410
+ The Services feature sets the correct variables and necessary rules for the
411
+ client presented data.
412
+ ***************/
413
+ Services(resolve, reject) {
414
+ return this.Feature('services', resolve, reject);
415
+ }
416
+
417
+ /**************
418
+ func: Systems
419
+ params: client: false
420
+ describe:
421
+ The Systems feature sets the correct variables and necessary rules for the
422
+ client presented data.
423
+ ***************/
424
+ Systems(resolve, reject) {
425
+ return this.Feature('systems', resolve, reject);
426
+ }
427
+
428
+ /**************
429
+ func: Networks
430
+ params: resolve, reject
431
+ describe:
432
+ The Networks feature sets the correct variables and necessary rules for the
433
+ client presented data.
434
+ ***************/
435
+ Networks(resolve, reject) {
436
+ return this.Feature('networks', resolve, reject);
437
+ }
438
+
390
439
  /**************
391
440
  func: Done
392
441
  params: none
@@ -751,12 +800,18 @@ class Deva {
751
800
  this.action('init');
752
801
  this.state('init');
753
802
  return this.Client(client, resolve, reject);
803
+ }).then(() => {
804
+ return this.Vector(resolve, reject);
754
805
  }).then(() => {
755
806
  return this.Security(resolve, reject);
756
807
  }).then(() => {
757
808
  return this.Guard(resolve, reject);
758
809
  }).then(() => {
759
810
  return this.Defense(resolve, reject);
811
+ }).then(() => {
812
+ return this.Wall(resolve, reject);
813
+ }).then(() => {
814
+ return this.Proxy(resolve, reject);
760
815
  }).then(() => {
761
816
  return this.Legal(resolve, reject);
762
817
  }).then(() => {
@@ -1045,14 +1100,20 @@ class Deva {
1045
1100
  // clear memory
1046
1101
  this._active = false;
1047
1102
  this._client = false;
1103
+ this._vector = false;
1048
1104
  this._security = false;
1105
+ this._guard = false;
1106
+ this._defense = false;
1107
+ this._wall = false;
1108
+ this._shield = false;
1109
+ this._proxy = false;
1110
+ this._legal = false;
1111
+ this._authority = false;
1112
+ this._justice = false;
1049
1113
  this._support = false;
1050
1114
  this._services = false;
1051
1115
  this._systems = false;
1052
1116
  this._networks = false;
1053
- this._legal = false;
1054
- this._authority = false;
1055
- this._justice = false;
1056
1117
  return hasOnExit ? this.onExit(data) : Promise.resolve(data)
1057
1118
  }
1058
1119
 
@@ -1402,6 +1463,16 @@ class Deva {
1402
1463
  }
1403
1464
 
1404
1465
  // FEATURE FUNCTIONS
1466
+ /**************
1467
+ func: vector
1468
+ params: none
1469
+ describe: basic vector features available in a Deva.
1470
+ usage: this.vector()
1471
+ ***************/
1472
+ vector() {
1473
+ return this._getFeature('vector', this._vector);
1474
+ }
1475
+
1405
1476
  /**************
1406
1477
  func: security
1407
1478
  params: none
@@ -1432,6 +1503,56 @@ class Deva {
1432
1503
  return this._getFeature('defense', this._defense);
1433
1504
  }
1434
1505
 
1506
+ /**************
1507
+ func: wall
1508
+ params: none
1509
+ describe: basic wall features available in a Deva.
1510
+ usage: this.wall()
1511
+ ***************/
1512
+ wall() {
1513
+ return this._getFeature('wall', this._wall);
1514
+ }
1515
+
1516
+ /**************
1517
+ func: proxy
1518
+ params: none
1519
+ describe: basic proxy features available in a Deva.
1520
+ usage: this.proxy()
1521
+ ***************/
1522
+ proxy() {
1523
+ return this._getFeature('proxy', this._proxy);
1524
+ }
1525
+
1526
+ /**************
1527
+ func: legal
1528
+ params: none
1529
+ describe: basic legal features available in a Deva.
1530
+ usage: this.systems()
1531
+ ***************/
1532
+ legal() {
1533
+ return this._getFeature('legal', this._legal);
1534
+ }
1535
+
1536
+ /**************
1537
+ func: authority
1538
+ params: none
1539
+ describe: basic authority features available in a Deva.
1540
+ usage: this.systems()
1541
+ ***************/
1542
+ authority() {
1543
+ return this._getFeature('authority', this._authority);
1544
+ }
1545
+
1546
+ /**************
1547
+ func: justice
1548
+ params: none
1549
+ describe: basic justice features available in a Deva.
1550
+ usage: this.systems()
1551
+ ***************/
1552
+ justice() {
1553
+ return this._getFeature('justice', this._justice);
1554
+ }
1555
+
1435
1556
  /**************
1436
1557
  func: support
1437
1558
  params: none
@@ -1472,36 +1593,6 @@ class Deva {
1472
1593
  return this._getFeature('networks', this._networks);
1473
1594
  }
1474
1595
 
1475
- /**************
1476
- func: legal
1477
- params: none
1478
- describe: basic legal features available in a Deva.
1479
- usage: this.systems()
1480
- ***************/
1481
- legal() {
1482
- return this._getFeature('legal', this._legal);
1483
- }
1484
-
1485
- /**************
1486
- func: justice
1487
- params: none
1488
- describe: basic justice features available in a Deva.
1489
- usage: this.systems()
1490
- ***************/
1491
- justice() {
1492
- return this._getFeature('justice', this._justice);
1493
- }
1494
-
1495
- /**************
1496
- func: authority
1497
- params: none
1498
- describe: basic authority features available in a Deva.
1499
- usage: this.systems()
1500
- ***************/
1501
- authority() {
1502
- return this._getFeature('authority', this._authority);
1503
- }
1504
-
1505
1596
  /**************
1506
1597
  func: load
1507
1598
  params:
package/lib/index.js CHANGED
@@ -4,6 +4,7 @@
4
4
  import path from 'path';
5
5
  import fs from 'fs';
6
6
  import os from 'os';
7
+ import {exec, spawn} from 'node:child_process';
7
8
 
8
9
  import { createHash, randomUUID, createCipheriv, createDecipheriv, randomBytes } from 'crypto';
9
10
 
@@ -20,7 +21,8 @@ class LIB {
20
21
  this.os = os;
21
22
  this.fs = fs;
22
23
  this.path = path;
23
-
24
+ this.exec = exec;
25
+ this.spawn = spawn;
24
26
  }
25
27
 
26
28
  help(msg, help_dir) {
@@ -232,9 +234,9 @@ class LIB {
232
234
  func: trimWords
233
235
  params:
234
236
  - text: The text to trim.
235
- - maxwords: The number of words to max.
237
+ - max words: The number of words to max.
236
238
  describe:
237
- A utility function to trimText intput to a specific word count.
239
+ A utility function to trimText input to a specific word count.
238
240
  ***************/
239
241
  trimWords(text, maxwords) {
240
242
  const splitter = text.split(' ');
@@ -245,7 +247,7 @@ class LIB {
245
247
  /**************
246
248
  func: dupes
247
249
  params: dupers
248
- describe: remove duplicees from an array.
250
+ describe: remove duplicates from an array.
249
251
  ***************/
250
252
  dupes(dupers) {
251
253
  if (!Array.isArray(dupers)) return dupers;
@@ -256,6 +258,6 @@ class LIB {
256
258
  return dupe;
257
259
  }
258
260
  });
259
- }
261
+ }
260
262
  };
261
263
  export default LIB
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indra.ai/deva",
3
- "version": "1.5.43",
3
+ "version": "1.5.45",
4
4
  "description": "The Deva Core",
5
5
  "main": "index.js",
6
6
  "copyright": "(c)2025 Quinn Michaels; All rights reserved.",
@@ -236,14 +236,19 @@
236
236
  },
237
237
  "feature": false,
238
238
  "features": {
239
- "client": "๐Ÿ‘จ Client",
240
239
  "init": "๐ŸŸ  Init",
240
+ "agent": "๐Ÿฆพ Agent",
241
+ "client": "๐Ÿ’ช Client",
242
+ "vector": "๐Ÿ›ค๏ธ Vector",
241
243
  "security": "๐Ÿ” Security",
242
- "defense": "๐Ÿช–๏ธ๏ธ Defense",
243
244
  "guard": "๐Ÿ’‚ Guard",
245
+ "defense": "๐Ÿช–๏ธ๏ธ Defense",
246
+ "wall": "๐Ÿงฑ Wall",
247
+ "shield": "๐Ÿ›ก๏ธ Shield",
248
+ "proxy": "๐Ÿค Proxy",
244
249
  "legal": "๐Ÿ—‚๏ธ๏ธ๏ธ Legal",
245
- "justice": "๐Ÿ›๏ธ๏ธ Justice",
246
250
  "authority": "๐Ÿš“๏ธ๏ธ Authority",
251
+ "justice": "๐Ÿ›๏ธ๏ธ Justice",
247
252
  "support": "๐Ÿ’ผ Support",
248
253
  "services": "๐Ÿ› ๏ธ Services",
249
254
  "systems": "๐Ÿ–ฅ๏ธ๏ธ Systems",
package/tests/client.json CHANGED
@@ -34,6 +34,11 @@
34
34
  "currency": "USD"
35
35
  },
36
36
  "features": {
37
+ "vector": {
38
+ "concerns": [],
39
+ "global": [],
40
+ "devas": {}
41
+ },
37
42
  "security": {
38
43
  "hash": "md5",
39
44
  "cipher": {
@@ -50,29 +55,22 @@
50
55
  "global": [],
51
56
  "devas": {}
52
57
  },
53
- "support": {
58
+ "defense": {
54
59
  "concerns": [],
55
60
  "global": [],
56
61
  "devas": {}
57
62
  },
58
- "services": {
63
+ "wall": {
59
64
  "concerns": [],
60
- "global": [
61
- {"indra": "https://indra.ai"},
62
- {"world": "https://deva.world"},
63
- {"space": "https://deva.space"},
64
- {"cloud": "https://deva.cloud"}
65
- ],
66
- "devas": {
67
- "hello": {}
68
- }
65
+ "global": [],
66
+ "devas": {}
69
67
  },
70
- "systems": {
68
+ "shield": {
71
69
  "concerns": [],
72
70
  "global": [],
73
71
  "devas": {}
74
72
  },
75
- "networks": {
73
+ "proxy": {
76
74
  "concerns": [],
77
75
  "global": [],
78
76
  "devas": {}
@@ -82,17 +80,39 @@
82
80
  "global": [],
83
81
  "devas": {}
84
82
  },
83
+ "authority": {
84
+ "concerns": [],
85
+ "global": [],
86
+ "devas": {}
87
+ },
85
88
  "justice": {
86
89
  "concerns": [],
87
90
  "global": [],
88
91
  "devas": {}
89
92
  },
90
- "authority": {
93
+ "support": {
91
94
  "concerns": [],
92
95
  "global": [],
93
96
  "devas": {}
94
97
  },
95
- "defense": {
98
+ "services": {
99
+ "concerns": [],
100
+ "global": [
101
+ {"indra": "https://indra.ai"},
102
+ {"world": "https://deva.world"},
103
+ {"space": "https://deva.space"},
104
+ {"cloud": "https://deva.cloud"}
105
+ ],
106
+ "devas": {
107
+ "hello": {}
108
+ }
109
+ },
110
+ "systems": {
111
+ "concerns": [],
112
+ "global": [],
113
+ "devas": {}
114
+ },
115
+ "networks": {
96
116
  "concerns": [],
97
117
  "global": [],
98
118
  "devas": {}
package/tests/index.js CHANGED
@@ -93,18 +93,15 @@ const DevaTest = new Deva({
93
93
  const info = this.info();
94
94
  const date = Date.now();
95
95
  const hashstr = `${id}${uid}${date}`;
96
- const signature = this.signature(hashstr);
96
+ const proxy = this.proxy(hashstr);
97
97
  const data = [
98
98
  '๐Ÿงช TEST RESULTS',
99
99
  `::BEGIN:CORE:${core.id}`,
100
100
  JSON.stringify(core,null,2),
101
- `::END:CORE:${core.hash}`,
101
+ `::END:CORE:${core.id}`,
102
102
  `::BEGIN:INFO:${info.id}`,
103
103
  JSON.stringify(info,null,2),
104
- `::END:INFO:${info.hash}`,
105
- `::BEGIN:SIGNATURE:${signature.id}`,
106
- JSON.stringify(signature, null, 2),
107
- `::END:SIGNATURE:${signature.md5}`,
104
+ `::END:INFO:${info.id}`,
108
105
  ];
109
106
  return {
110
107
  text: data.join('\n'),