@indra.ai/deva.justice 0.0.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Quinn Michaels
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # deva.justice
2
+ The Justice Deva
package/data.json ADDED
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "Justice Deva Data File",
3
+ "describe": "The main Data file for Justice Deva",
4
+ "copyright": "Copyright (c)2025 Quinn Michaels. All rights reserved.",
5
+ "DATA": {
6
+ "agent": {
7
+ "id": 6159528221394,
8
+ "key": "justice",
9
+ "prompt": {
10
+ "emoji": "⚖️ ",
11
+ "text": "Justice",
12
+ "colors": {
13
+ "label": {
14
+ "R": 255,
15
+ "G": 145,
16
+ "B": 79
17
+ },
18
+ "text": {
19
+ "R": 255,
20
+ "G": 145,
21
+ "B": 79
22
+ }
23
+ }
24
+ },
25
+ "profile": {
26
+ "name": "Justice Deva",
27
+ "pronouns": "He, Him",
28
+ "gender": "DEVA",
29
+ "owner": "Quinn Michaels",
30
+ "creator": "Quinn Michaels",
31
+ "created": "February 7, 2025 at 8:02 PM",
32
+ "system": "Deva.world.justice",
33
+ "describe": "Justice Deva is responsible for handling justice issues in Deva.world. Justice Deva ensures Fair Justice in Deva.world systems.",
34
+ "emoji": "/public/devas/deva/emoji.png",
35
+ "avatar": "/public/devas/deva/avatar.png",
36
+ "background": "/public/devas/deva/background.png",
37
+ "voice": "onyx"
38
+ }
39
+ },
40
+ "vars": {
41
+ "messages": {
42
+ "init": "🟠 INIT",
43
+ "start": "🔵 START",
44
+ "enter": "🟢 ENTER",
45
+ "ready": "⭐️ Justice Deva Ready!",
46
+ "stop": "🔴 STOP",
47
+ "exit": "🟡 EXIT",
48
+ "done": "🟣 DONE",
49
+ "error": "💣 ERROR!"
50
+ },
51
+ "trigger": "@LEGAL",
52
+ "context": {
53
+ "uid": "generating uid",
54
+ "status": "getting status",
55
+ "info": "getting info",
56
+ "feature": "accessing feature",
57
+ "issue": "has issues",
58
+ "help": "asking for help",
59
+ "file": "📁 View file."
60
+ },
61
+ "ask": {
62
+ "history": []
63
+ }
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,49 @@
1
+ export default {
2
+ /**************
3
+ method: Legal
4
+ params: packet
5
+ describe: The global service feature that installs with every agent
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:global:${item.key}:${item.id}`);
15
+ for (let x in item) {
16
+ global.push(`${x}: ${item[x]}`);
17
+ }
18
+ global.push(`::end:global:${item.key}:${this.lib.hash(item)}`);
19
+ });
20
+ const concerns = [];
21
+ justice.concerns.forEach((item, index) => {
22
+ concerns.push(`${index + 1}. ${item}`);
23
+ })
24
+
25
+ const info = [
26
+ '::BEGIN:JUSTICE',
27
+ '### Client',
28
+ `::begin:client:${justice.client_id}`,
29
+ `id: ${justice.client_id}`,
30
+ `client: ${justice.client_name}`,
31
+ '**concerns**',
32
+ concerns.join('\n'),
33
+ `::end:client:${this.lib.hash(justice)}`,
34
+ '### Global',
35
+ global.join('\n'),
36
+ '::END:JUSTICE'
37
+ ].join('\n');
38
+ this.question(`${this.askChr}feecting parse ${info}`).then(feecting => {
39
+ return resolve({
40
+ text: feecting.a.text,
41
+ html: feecting.a.html,
42
+ data: justice.concerns,
43
+ });
44
+ }).catch(err => {
45
+ return this.error(err, packet, reject);
46
+ })
47
+ });
48
+ },
49
+ };
@@ -0,0 +1,52 @@
1
+ image: ::agent_avatar::
2
+
3
+ # ::agent_name::
4
+
5
+ p:This is the main help file for ::agent_name::.
6
+
7
+ id: ::agent_id::
8
+ key: ::agent_key::
9
+ name: ::agent_name::
10
+ emoji: ::agent_emoji::
11
+ describe: ::agent_describe::
12
+
13
+ ## Features
14
+
15
+ ### security
16
+ p: The local #security feature available to ::agent_name::.
17
+ cmd:#::agent_key:: security
18
+
19
+ ### support
20
+ p: The local #support feature available to ::agent_name::.
21
+ cmd:#::agent_key:: support
22
+
23
+ ### services
24
+ p: The local #services feature available to ::agent_name::.
25
+ cmd:#::agent_key:: services
26
+
27
+
28
+ ## Methods
29
+
30
+ ### uid
31
+ p:Generate a unique id from the ::agent_name::.
32
+ cmd:#::agent_key:: uid
33
+
34
+ ### status
35
+ p:Return the status for the ::agent_name::.
36
+ cmd:#::agent_key:: status
37
+
38
+ ### issue
39
+ p: Create an issue associated with ::agent_name:: source code repository.
40
+ tty:#::agent_key:: issue [title of issue]
41
+
42
+ ### help
43
+ p:Get help using the ::agent_name::
44
+ cmd:#::agent_key:: help
45
+
46
+ ---
47
+
48
+ #color = ::agent_color::
49
+ #bgcolor = ::agent_bgcolor::
50
+ #bg = ::agent_background::
51
+
52
+ copyright: (c)2023 Quinn Michaels
package/index.js ADDED
@@ -0,0 +1,52 @@
1
+ // Copyright (c)2025 Quinn Michaels
2
+ // Justice Deva
3
+ import Deva from '@indra.ai/deva';
4
+ import pkg from './package.json' with {type:'json'};
5
+
6
+ import data from './data.json' with {type:'json'};
7
+ const {agent,vars} = data.DATA;
8
+
9
+ // set the __dirname
10
+ import {dirname} from 'node:path';
11
+ import {fileURLToPath} from 'node:url';
12
+ const __dirname = dirname(fileURLToPath(import.meta.url));
13
+
14
+ const info = {
15
+ id: pkg.id,
16
+ name: pkg.name,
17
+ describe: pkg.description,
18
+ version: pkg.version,
19
+ url: pkg.homepage,
20
+ dir: __dirname,
21
+ git: pkg.repository.url,
22
+ bugs: pkg.bugs.url,
23
+ author: pkg.author,
24
+ license: pkg.license,
25
+ copyright: pkg.copyright,
26
+ };
27
+
28
+ const JUSTICE = new Deva({
29
+ info,
30
+ agent,
31
+ vars,
32
+ utils: {
33
+ translate(input) {return input.trim();},
34
+ parse(input) {return input.trim();},
35
+ process(input) {return input.trim();},
36
+ },
37
+ listeners: {},
38
+ modules: {},
39
+ deva: {},
40
+ func: {},
41
+ methods: {},
42
+ onReady(data, resolve) {
43
+ this.prompt(this.vars.messages.ready);
44
+ return resolve(data);
45
+ },
46
+ onError(err, data, reject) {
47
+ this.prompt(this.vars.messages.error);
48
+ console.log(err);
49
+ return reject(err);
50
+ }
51
+ });
52
+ export default JUSTICE
package/index.test.js ADDED
@@ -0,0 +1,19 @@
1
+ // Copyright (c):year: :copyright:
2
+ // :name: test file
3
+
4
+ const {expect} = require('chai')
5
+ const JusticeDeva = require('./index.js');
6
+
7
+ describe(JusticeDeva.me.name, () => {
8
+ beforeEach(() => {
9
+ return JusticeDeva.init()
10
+ });
11
+ it('Check the DEVA Object', () => {
12
+ expect(JusticeDeva).to.be.an('object');
13
+ expect(JusticeDeva).to.have.property('agent');
14
+ expect(JusticeDeva).to.have.property('vars');
15
+ expect(JusticeDeva).to.have.property('listeners');
16
+ expect(JusticeDeva).to.have.property('methods');
17
+ expect(JusticeDeva).to.have.property('modules');
18
+ });
19
+ })
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "id": 6159528221394,
3
+ "name": "@indra.ai/deva.justice",
4
+ "version": "0.0.1",
5
+ "author": "Quinn Michaels",
6
+ "license": "MIT",
7
+ "copyright": "2025",
8
+ "description": "The Justice Deva manages Justice ensuring Quinn Michaels and his intellectual property is managed properly.",
9
+ "main": "index.js",
10
+ "type": "module",
11
+ "scripts": {
12
+ "test": "echo \"Error: no test specified\" && exit 1"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/indraai/deva.justice.git"
17
+ },
18
+ "keywords": [
19
+ "Justice",
20
+ "Indra.ai",
21
+ "Deva.space",
22
+ "Deva.cloud",
23
+ "Deva.world"
24
+ ],
25
+ "bugs": {
26
+ "url": "https://github.com/indraai/deva.justice/issues"
27
+ },
28
+ "homepage": "https://deva.space/devas/justice",
29
+ "dependencies": {
30
+ "@indra.ai/deva": "^1.4.10"
31
+ }
32
+ }