@indra.ai/deva.justice 0.0.28 → 0.0.30

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.
@@ -1,55 +1,11 @@
1
1
  export default {
2
2
  /**************
3
- method: Justice
3
+ method: justice
4
4
  params: packet
5
- describe: The global service feature that installs with every agent
5
+ describe: The global justice feature that installs with every agent
6
6
  ***************/
7
- justice(packet) {
8
- this.context('feature');
9
- return new Promise((resolve, reject) => {
10
- const justice = this.justice();
11
- const agent = this.agent();
12
- const global = [];
13
- justice.global.forEach((item,index) => {
14
- global.push(`::begin:${item.key}:${item.id}`);
15
- for (let x in item) {
16
- global.push(`${x}: ${item[x]}`);
17
- }
18
- const thehash = this.lib.hash(item);
19
- global.push(`hash: ${thehash}`);
20
- global.push(`::end:${item.key}:${thehash}`);
21
- });
22
- const concerns = [];
23
- justice.concerns.forEach((item, index) => {
24
- concerns.push(`${index + 1}. ${item}`);
25
- })
26
-
27
- const info = [
28
- '::BEGIN:JUSTICE',
29
- `::begin:client`,
30
- '## Client',
31
- `id: ${justice.client_id}`,
32
- `client: ${justice.client_name}`,
33
- `::end:client}`,
34
- concerns.length ? `::begin:concerns` : '',
35
- concerns.length ? '## Concerns' : '',
36
- concerns.length ? concerns.join('\n') : '',
37
- concerns.length ? `::end:concerns` : '',
38
- '::begin:global',
39
- '## Global',
40
- global.join('\n'),
41
- '::end:global',
42
- '::END:JUSTICE',
43
- ].join('\n');
44
- this.question(`${this.askChr}feecting parse ${info}`).then(feecting => {
45
- return resolve({
46
- text: feecting.a.text,
47
- html: feecting.a.html,
48
- data: justice.concerns,
49
- });
50
- }).catch(err => {
51
- return this.error(err, packet, reject);
52
- })
53
- });
7
+ async justice(packet) {
8
+ const justice = await this.methods.sign('justice', 'default', packet);
9
+ return justice;
54
10
  },
55
11
  };
package/index.js CHANGED
@@ -32,7 +32,14 @@ const JUSTICE = new Deva({
32
32
  parse(input) {return input.trim();},
33
33
  process(input) {return input.trim();},
34
34
  },
35
- listeners: {},
35
+ listeners: {
36
+ 'devacore:question'(packet) {
37
+ const echo = this.methods.echo('defense', 'q', packet);
38
+ },
39
+ 'devacore:answer'(packet) {
40
+ const echo = this.methods.echo('defense', 'a', packet);
41
+ }
42
+ },
36
43
  modules: {},
37
44
  deva: {},
38
45
  func: {},
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": 6159528221394,
3
3
  "name": "@indra.ai/deva.justice",
4
- "version": "0.0.28",
4
+ "version": "0.0.30",
5
5
  "author": "Quinn Michaels",
6
6
  "license": "MIT",
7
7
  "copyright": "2025",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "homepage": "https://deva.space/devas/justice",
29
29
  "dependencies": {
30
- "@indra.ai/deva": "^1.5.49"
30
+ "@indra.ai/deva": "^1.5.50"
31
31
  },
32
32
  "data": {
33
33
  "agent": {