@indra.ai/deva.wall 0.0.2 → 0.0.4
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 +43 -5
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
// Copyright (c)2025 Quinn
|
|
2
|
-
//
|
|
1
|
+
// Copyright (c)2025 Quinn Michaels
|
|
2
|
+
// Wall Deva
|
|
3
3
|
|
|
4
4
|
import Deva from '@indra.ai/deva';
|
|
5
5
|
import pkg from './package.json' with {type:'json'};
|
|
6
6
|
const {agent,vars} = pkg.data;
|
|
7
7
|
|
|
8
|
+
import {exec, spawn} from 'node:child_process';
|
|
9
|
+
|
|
8
10
|
// set the __dirname
|
|
9
11
|
import {dirname} from 'node:path';
|
|
10
12
|
import {fileURLToPath} from 'node:url';
|
|
@@ -24,7 +26,7 @@ const info = {
|
|
|
24
26
|
copyright: pkg.copyright
|
|
25
27
|
};
|
|
26
28
|
|
|
27
|
-
const
|
|
29
|
+
const WALL = new Deva({
|
|
28
30
|
info,
|
|
29
31
|
agent,
|
|
30
32
|
vars,
|
|
@@ -33,14 +35,49 @@ const VAISYA = new Deva({
|
|
|
33
35
|
parse(input) {return input.trim();},
|
|
34
36
|
process(input) {return input.trim();},
|
|
35
37
|
},
|
|
36
|
-
listeners: {
|
|
38
|
+
listeners: {
|
|
39
|
+
'devacore:question'(packet) {
|
|
40
|
+
const md5 = this.lib.hash(packet, 'md5');
|
|
41
|
+
const sha256 = this.lib.hash(packet, 'sha256');
|
|
42
|
+
const sha512 = this.lib.hash(packet, 'sha512');
|
|
43
|
+
const echostr = `transport: ${packet.id} md5:${md5} | sha256:${sha256} | sha512:${sha512} | created:${packet.created}`;
|
|
44
|
+
// stub for later features right now just echo into the system process for SIGINT monitoring.
|
|
45
|
+
exec(`echo "${echostr}"`, (error, stdout, stderr) => {
|
|
46
|
+
if (error) {
|
|
47
|
+
console.log('error', error);
|
|
48
|
+
}
|
|
49
|
+
else if (stderr) {
|
|
50
|
+
console.log('stderr', stderr);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
'devacore:answer'(packet) {
|
|
55
|
+
const md5 = this.lib.hash(packet, 'md5');
|
|
56
|
+
const sha256 = this.lib.hash(packet, 'sha256');
|
|
57
|
+
const sha512 = this.lib.hash(packet, 'sha512');
|
|
58
|
+
const echostr = `transport: ${packet.id} md5:${md5} | sha256:${sha256} | sha512:${sha512} | created:${packet.created}`;
|
|
59
|
+
// stub for later features right now just echo into the system process for SIGINT monitoring.
|
|
60
|
+
exec(`echo "${echostr}"`, (error, stdout, stderr) => {
|
|
61
|
+
if (error) {
|
|
62
|
+
console.log('error', error);
|
|
63
|
+
}
|
|
64
|
+
else if (stderr) {
|
|
65
|
+
console.log('stderr', stderr);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
},
|
|
37
70
|
modules: {},
|
|
38
71
|
devas: {},
|
|
39
72
|
func: {},
|
|
40
73
|
methods: {},
|
|
41
74
|
onReady(data, resolve) {
|
|
42
75
|
this.prompt(this.vars.messages.ready);
|
|
76
|
+
this.vars.userinfo = this.lib.os.userInfo();
|
|
77
|
+
|
|
78
|
+
console.log('userinfo', this.vars.userinfo);
|
|
43
79
|
return resolve(data);
|
|
80
|
+
|
|
44
81
|
},
|
|
45
82
|
onError(data, err, reject) {
|
|
46
83
|
this.prompt(this.vars.messages.error);
|
|
@@ -48,4 +85,5 @@ const VAISYA = new Deva({
|
|
|
48
85
|
return reject(err);
|
|
49
86
|
},
|
|
50
87
|
});
|
|
51
|
-
export default
|
|
88
|
+
export default WALL
|
|
89
|
+
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"id": "
|
|
2
|
+
"id": "b7b9269a-82be-4735-852c-a2bc08ca0629",
|
|
3
3
|
"name": "@indra.ai/deva.wall",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.4",
|
|
5
5
|
"author": "Quinn Michaels",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"copyright": "2025",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"data": {
|
|
34
34
|
"agent": {
|
|
35
|
-
"id": "
|
|
35
|
+
"id": "3fff10dc-50fa-40c9-b675-d234479e6871",
|
|
36
36
|
"key": "wall",
|
|
37
37
|
"prompt": {
|
|
38
38
|
"emoji": "🧱",
|