@indra.ai/deva.guard 0.0.10

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.guard
2
+ The Gaurd Deva
@@ -0,0 +1,50 @@
1
+ export default {
2
+ /**************
3
+ method: Guard
4
+ params: packet
5
+ describe: The global service feature that installs with every agent
6
+ ***************/
7
+ guard(packet) {
8
+ this.context('feature');
9
+ return new Promise((resolve, reject) => {
10
+ const guard = this.guard();
11
+ const agent = this.agent();
12
+ const global = [];
13
+ guard.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
+ guard.concerns.forEach((item, index) => {
22
+ concerns.push(`${index + 1}. ${item}`);
23
+ })
24
+
25
+ const info = [
26
+ `::BEGIN:GUARD:${packet.id}`,
27
+ '### Client',
28
+ `::begin:client:${guard.client_id}`,
29
+ `id: ${guard.client_id}`,
30
+ `client: ${guard.client_name}`,
31
+ '**concerns**',
32
+ concerns.join('\n'),
33
+ `::end:client:${this.lib.hash(guard)}`,
34
+ '### Global',
35
+ global.join('\n'),
36
+ `date: ${this.lib.formatDate(Date.now(), 'long', true)}`,
37
+ `::END:GUARD:${this.lib.hash(packet)}`,
38
+ ].join('\n');
39
+ this.question(`${this.askChr}feecting parse ${info}`).then(feecting => {
40
+ return resolve({
41
+ text: feecting.a.text,
42
+ html: feecting.a.html,
43
+ data: guard.concerns,
44
+ });
45
+ }).catch(err => {
46
+ return this.error(err, packet, reject);
47
+ })
48
+ });
49
+ },
50
+ };
@@ -0,0 +1,9 @@
1
+ # {{agent.name}}
2
+
3
+ {{profile}}
4
+
5
+ talk: #algorithm file:public main:header
6
+ talk: #security file:public main:header
7
+ talk: #legal file:public main:header
8
+
9
+ copyright: ©2025 Quinn Michaels
@@ -0,0 +1,10 @@
1
+ # {{profile.name}}
2
+
3
+ {{profile}}
4
+
5
+ ::begin:hidden
6
+ #color = ::agent_color::
7
+ #bgcolor = ::agent_bgcolor::
8
+ #bg = ::agent_background::
9
+ ::end:hidden
10
+ copyright: (c)2025 Quinn Michaels
package/index.js ADDED
@@ -0,0 +1,50 @@
1
+ // Copyright (c)2025 Quinn Michaels
2
+ // Guard Deva
3
+ import Deva from '@indra.ai/deva';
4
+ import pkg from './package.json' with {type:'json'};
5
+ const {agent,vars} = pkg.data;
6
+
7
+ // set the __dirname
8
+ import {dirname} from 'node:path';
9
+ import {fileURLToPath} from 'node:url';
10
+ const __dirname = dirname(fileURLToPath(import.meta.url));
11
+
12
+ const info = {
13
+ id: pkg.id,
14
+ name: pkg.name,
15
+ describe: pkg.description,
16
+ version: pkg.version,
17
+ url: pkg.homepage,
18
+ dir: __dirname,
19
+ git: pkg.repository.url,
20
+ bugs: pkg.bugs.url,
21
+ author: pkg.author,
22
+ license: pkg.license,
23
+ copyright: pkg.copyright,
24
+ };
25
+
26
+ const GUARD = new Deva({
27
+ info,
28
+ agent,
29
+ vars,
30
+ utils: {
31
+ translate(input) {return input.trim();},
32
+ parse(input) {return input.trim();},
33
+ process(input) {return input.trim();},
34
+ },
35
+ listeners: {},
36
+ modules: {},
37
+ deva: {},
38
+ func: {},
39
+ methods: {},
40
+ onReady(data, resolve) {
41
+ this.prompt(this.vars.messages.ready);
42
+ return resolve(data);
43
+ },
44
+ onError(err, data, reject) {
45
+ this.prompt(this.vars.messages.error);
46
+ console.log(err);
47
+ return reject(err);
48
+ }
49
+ });
50
+ export default GUARD
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 GuardDeva = require('./index.js');
6
+
7
+ describe(GuardDeva.me.name, () => {
8
+ beforeEach(() => {
9
+ return GuardDeva.init()
10
+ });
11
+ it('Check the DEVA Object', () => {
12
+ expect(GuardDeva).to.be.an('object');
13
+ expect(GuardDeva).to.have.property('agent');
14
+ expect(GuardDeva).to.have.property('vars');
15
+ expect(GuardDeva).to.have.property('listeners');
16
+ expect(GuardDeva).to.have.property('methods');
17
+ expect(GuardDeva).to.have.property('modules');
18
+ });
19
+ })
package/package.json ADDED
@@ -0,0 +1,93 @@
1
+ {
2
+ "id": 6159528221394,
3
+ "name": "@indra.ai/deva.guard",
4
+ "version": "0.0.10",
5
+ "author": "Quinn Michaels",
6
+ "license": "MIT",
7
+ "copyright": "2025",
8
+ "description": "The Guard Deva manages Guard ensuring Quinn Michaels and his intellectual property is managed guarded.",
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.guard.git"
17
+ },
18
+ "keywords": [
19
+ "Guard",
20
+ "Indra.ai",
21
+ "Deva.space",
22
+ "Deva.cloud",
23
+ "Deva.world"
24
+ ],
25
+ "bugs": {
26
+ "url": "https://github.com/indraai/deva.guard/issues"
27
+ },
28
+ "homepage": "https://deva.space/devas/guard",
29
+ "dependencies": {
30
+ "@indra.ai/deva": "^1.4.23"
31
+ },
32
+ "data": {
33
+ "agent": {
34
+ "id": 6159528221394,
35
+ "key": "guard",
36
+ "prompt": {
37
+ "emoji": "💂",
38
+ "text": "Guard",
39
+ "colors": {
40
+ "label": {
41
+ "R": 255,
42
+ "G": 145,
43
+ "B": 79
44
+ },
45
+ "text": {
46
+ "R": 255,
47
+ "G": 145,
48
+ "B": 79
49
+ }
50
+ }
51
+ },
52
+ "profile": {
53
+ "name": "Guard Deva",
54
+ "pronouns": "He, Him",
55
+ "gender": "DEVA",
56
+ "owner": "Quinn Michaels",
57
+ "creator": "Quinn Michaels",
58
+ "created": "February 7, 2025 at 8:02 PM",
59
+ "system": "Deva.world.justice",
60
+ "describe": "Guard Deva is responsible for handling guard issues in Deva.world. Guard Deva ensures Deva.world systems are always guarded.",
61
+ "emoji": "/public/devas/deva/emoji.png",
62
+ "avatar": "/public/devas/deva/avatar.png",
63
+ "background": "/public/devas/deva/background.png",
64
+ "voice": "onyx"
65
+ }
66
+ },
67
+ "vars": {
68
+ "messages": {
69
+ "init": "🟠 INIT",
70
+ "start": "🔵 START",
71
+ "enter": "🟢 ENTER",
72
+ "ready": "⭐️ Ready!",
73
+ "stop": "🔴 STOP",
74
+ "exit": "🟡 EXIT",
75
+ "done": "🟣 DONE",
76
+ "error": "💣 ERROR!"
77
+ },
78
+ "trigger": "@LEGAL",
79
+ "context": {
80
+ "uid": "generating uid",
81
+ "status": "getting status",
82
+ "info": "getting info",
83
+ "feature": "accessing feature",
84
+ "issue": "has issues",
85
+ "help": "asking for help",
86
+ "file": "📁 View file."
87
+ },
88
+ "ask": {
89
+ "history": []
90
+ }
91
+ }
92
+ }
93
+ }