@indra.ai/deva.vector 0.0.3
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 +21 -0
- package/README.md +4 -0
- package/index.js +72 -0
- package/index.test.js +19 -0
- package/package.json +108 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Quinn A 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
package/index.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// Copyright (c)2025 Quinn Michaels
|
|
2
|
+
// Wall Deva
|
|
3
|
+
|
|
4
|
+
import Deva from '@indra.ai/deva';
|
|
5
|
+
import pkg from './package.json' with {type:'json'};
|
|
6
|
+
const {agent,vars} = pkg.data;
|
|
7
|
+
|
|
8
|
+
import {exec, spawn} from 'node:child_process';
|
|
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
|
+
version: pkg.version,
|
|
18
|
+
author: pkg.author,
|
|
19
|
+
describe: pkg.description,
|
|
20
|
+
dir: __dirname,
|
|
21
|
+
url: pkg.homepage,
|
|
22
|
+
git: pkg.repository.url,
|
|
23
|
+
bugs: pkg.bugs.url,
|
|
24
|
+
license: pkg.license,
|
|
25
|
+
copyright: pkg.copyright
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const WALL = 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
|
+
'devacore:question'(packet) {
|
|
39
|
+
this.prompt(packet.md5);
|
|
40
|
+
const question = JSON.stringify(packet.q).replace(/'/, '\'').replace(/"/, '\"');
|
|
41
|
+
// stub for later features right now just echo into the system process for SIGINT monitoring.
|
|
42
|
+
exec(`echo "${packet.q.text}"`, (error, stdout, stderr) => {
|
|
43
|
+
const result = stdout.split('\n');
|
|
44
|
+
if (error) {
|
|
45
|
+
console.log('error', error);
|
|
46
|
+
}
|
|
47
|
+
else if (stderr) {
|
|
48
|
+
console.log('stderr', stderr);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
modules: {},
|
|
54
|
+
devas: {},
|
|
55
|
+
func: {},
|
|
56
|
+
methods: {},
|
|
57
|
+
onReady(data, resolve) {
|
|
58
|
+
this.prompt(this.vars.messages.ready);
|
|
59
|
+
this.vars.userinfo = this.lib.os.userInfo();
|
|
60
|
+
|
|
61
|
+
console.log('userinfo', this.vars.userinfo);
|
|
62
|
+
return resolve(data);
|
|
63
|
+
|
|
64
|
+
},
|
|
65
|
+
onError(data, err, reject) {
|
|
66
|
+
this.prompt(this.vars.messages.error);
|
|
67
|
+
console.log(err);
|
|
68
|
+
return reject(err);
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
export default WALL
|
|
72
|
+
|
package/index.test.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Copyright (c)2025 Quinn A Michaels
|
|
2
|
+
// Indra Deva test file
|
|
3
|
+
|
|
4
|
+
const {expect} = require('chai')
|
|
5
|
+
const :key: = require('./index.js');
|
|
6
|
+
|
|
7
|
+
describe(indra.me.name, () => {
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
return indra.init()
|
|
10
|
+
});
|
|
11
|
+
it('Check the DEVA Object', () => {
|
|
12
|
+
expect(indra).to.be.an('object');
|
|
13
|
+
expect(indra).to.have.property('agent');
|
|
14
|
+
expect(indra).to.have.property('vars');
|
|
15
|
+
expect(indra).to.have.property('listeners');
|
|
16
|
+
expect(indra).to.have.property('methods');
|
|
17
|
+
expect(indra).to.have.property('modules');
|
|
18
|
+
});
|
|
19
|
+
})
|
package/package.json
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "835ebdd3-17dc-4b53-a6e3-02d089700f4",
|
|
3
|
+
"name": "@indra.ai/deva.vector",
|
|
4
|
+
"version": "0.0.3",
|
|
5
|
+
"author": "Quinn Michaels",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"copyright": "2025",
|
|
8
|
+
"description": "The Vector Deva.",
|
|
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.vector.git"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"Vector",
|
|
20
|
+
"Deva",
|
|
21
|
+
"Indra.ai",
|
|
22
|
+
"Deva.space",
|
|
23
|
+
"Deva.cloud",
|
|
24
|
+
"Deva.world"
|
|
25
|
+
],
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/indraai/deva.vector/issues"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://deva.space/devas/wall",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@indra.ai/deva": "^1.5.42"
|
|
32
|
+
},
|
|
33
|
+
"data": {
|
|
34
|
+
"agent": {
|
|
35
|
+
"id": "fdc56065-5e10-4419-aa6a-6858639685ce",
|
|
36
|
+
"key": "vector",
|
|
37
|
+
"prompt": {
|
|
38
|
+
"emoji": "🛤️",
|
|
39
|
+
"text": "Vector",
|
|
40
|
+
"colors": {
|
|
41
|
+
"label": {
|
|
42
|
+
"R": 0,
|
|
43
|
+
"G": 150,
|
|
44
|
+
"B": 255
|
|
45
|
+
},
|
|
46
|
+
"text": {
|
|
47
|
+
"R": 101,
|
|
48
|
+
"G": 192,
|
|
49
|
+
"B": 255
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"profile": {
|
|
54
|
+
"name": "Vector Deva",
|
|
55
|
+
"hashtag": "#Vector",
|
|
56
|
+
"title": "Vector Deva",
|
|
57
|
+
"subtitle": "Vector Deva for the VectorGuardWall.",
|
|
58
|
+
"describe": "Vector Deva",
|
|
59
|
+
"post": "Vector.",
|
|
60
|
+
"hashtags": "QuinnMichaels,IndraAI,DevaWorld,VectorDeva",
|
|
61
|
+
"pronouns": "He, Him",
|
|
62
|
+
"gender": "DEVA",
|
|
63
|
+
"voice": "ash",
|
|
64
|
+
"style": "A Cyber Security Vector.",
|
|
65
|
+
"system": "Deva.world.vector",
|
|
66
|
+
"layout": "default",
|
|
67
|
+
"emoji": "/assets/devas/vector/emoji.png",
|
|
68
|
+
"avatar": "/assets/devas/vector/avatar.png",
|
|
69
|
+
"image": "/assets/devas/vector/image.png",
|
|
70
|
+
"background": "/assets/devas/vector/background.png",
|
|
71
|
+
"creator": "Quinn Michaels",
|
|
72
|
+
"owner": "Quinn Michaels",
|
|
73
|
+
"caseid": "none",
|
|
74
|
+
"copyright": "©2025 Quinn Michaels. All rights reserved.",
|
|
75
|
+
"created": "Friday, August 29, 2025 - 4:38:05 PM",
|
|
76
|
+
"modified": "Friday, August 29, 2025 - 4:38:05 PM"
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"vars": {
|
|
80
|
+
"messages": {
|
|
81
|
+
"init": "🟠 INIT",
|
|
82
|
+
"start": "🔵 START",
|
|
83
|
+
"enter": "🟢 ENTER",
|
|
84
|
+
"stop": "🔴 STOP",
|
|
85
|
+
"exit": "🟡 EXIT",
|
|
86
|
+
"done": "🟣 DONE",
|
|
87
|
+
"error": "💣 ERROR!",
|
|
88
|
+
"ready": "⭐️ Ready!"
|
|
89
|
+
},
|
|
90
|
+
"ask": {
|
|
91
|
+
"history": []
|
|
92
|
+
},
|
|
93
|
+
"art": {
|
|
94
|
+
"history": []
|
|
95
|
+
},
|
|
96
|
+
"context": {
|
|
97
|
+
"uid": "Vector is creating a uid",
|
|
98
|
+
"status": "Vector is viewing the status",
|
|
99
|
+
"help": "Vector is viewing the help",
|
|
100
|
+
"artist": "Vector creating",
|
|
101
|
+
"live": "Vector livechat",
|
|
102
|
+
"ask": "Vector asking",
|
|
103
|
+
"reply": "Vector reply",
|
|
104
|
+
"comment": "Vector comment"
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|