@indra.ai/deva.security 0.1.5 → 0.2.0
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/feature/methods.js +72 -65
- package/package.json +6 -4
package/feature/methods.js
CHANGED
|
@@ -22,48 +22,56 @@ export default {
|
|
|
22
22
|
***************/
|
|
23
23
|
async uid(packet) {
|
|
24
24
|
return new Promise((resolve, reject) => {
|
|
25
|
-
this.belief('security', `uid:${packet.id.uid}`)
|
|
26
25
|
this.context('uid', packet.id.uid);
|
|
27
26
|
this.feature('security', `uid:${packet.id.uid}`);
|
|
28
27
|
this.zone('security', `uid:${packet.id.uid}`);
|
|
28
|
+
this.belief('security', `uid:${packet.id.uid}`)
|
|
29
|
+
const {client} = packet.q;
|
|
29
30
|
const agent = this.agent();
|
|
30
31
|
const {key} = agent;
|
|
31
|
-
|
|
32
|
+
|
|
32
33
|
const uuid = packet.q.text ? true : false
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
const showJSON = packet.q.meta.params[1] || false;
|
|
34
|
+
const id = this.uid(uuid);
|
|
35
|
+
|
|
36
|
+
const showJSON = packet.q.meta.params[1] || false;
|
|
37
|
+
const status = agent.profile.status ? `${key}:${agent.profile.status}:uid:${id.uid}` : `${key}:vedic:uid:${id.uid}`;
|
|
38
38
|
const text = [
|
|
39
|
-
`::begin:${
|
|
39
|
+
`::begin:${status}`,
|
|
40
40
|
`uid: ${id.uid}`,
|
|
41
41
|
`time: ${id.time}`,
|
|
42
42
|
`date: ${id.date}`,
|
|
43
|
-
`
|
|
44
|
-
`agent: ${id.agent}`,
|
|
45
|
-
`core: ${id.core}`,
|
|
46
|
-
`machine: ${id.machine}`,
|
|
43
|
+
`fingerprint: ${id.fingerprint}`,
|
|
47
44
|
`warning: ${id.warning}`,
|
|
48
45
|
`copyright: ${id.copyright}`,
|
|
49
46
|
`md5: ${id.md5}`,
|
|
50
47
|
`sha256: ${id.sha256}`,
|
|
51
48
|
`sha512: ${id.sha512}`,
|
|
52
|
-
`::end:${
|
|
49
|
+
`::end:${status}`,
|
|
53
50
|
];
|
|
51
|
+
const data = {
|
|
52
|
+
uid: id.uid,
|
|
53
|
+
time: id.time,
|
|
54
|
+
date: id.date,
|
|
55
|
+
fingerpring: id.fingerprint,
|
|
56
|
+
warning: id.warning,
|
|
57
|
+
copyright: id.copyright,
|
|
58
|
+
md5: id.md5,
|
|
59
|
+
sha256: id.sha256,
|
|
60
|
+
sha512: id.sha512,
|
|
61
|
+
}
|
|
54
62
|
if (showJSON) {
|
|
55
|
-
text.push(`::begin:${key}:uid:json:${
|
|
56
|
-
text.push(JSON.stringify(
|
|
57
|
-
text.push(`::end:${key}:uid:json:${
|
|
63
|
+
text.push(`::begin:${key}:uid:json:${data.uid}`);
|
|
64
|
+
text.push(JSON.stringify(data, null, 2));
|
|
65
|
+
text.push(`::end:${key}:uid:json:${data.uid}`);
|
|
58
66
|
}
|
|
59
67
|
|
|
60
68
|
this.question(`${this.askChr}feecting parse ${text.join('\n')}`).then(parsed => {
|
|
61
69
|
this.belief('vedic', `uid:${packet.id.uid}`);
|
|
62
|
-
this.action('resolve', `uid:${id.uid}`);
|
|
70
|
+
this.action('resolve', `uid:${packet.id.uid}`);
|
|
63
71
|
return resolve({
|
|
64
72
|
text: parsed.a.text,
|
|
65
73
|
html: parsed.a.html,
|
|
66
|
-
data
|
|
74
|
+
data,
|
|
67
75
|
});
|
|
68
76
|
}).catch(err => {
|
|
69
77
|
return this.err(err, packet, reject);
|
|
@@ -73,6 +81,52 @@ export default {
|
|
|
73
81
|
});
|
|
74
82
|
},
|
|
75
83
|
|
|
84
|
+
async sign(packet) {
|
|
85
|
+
const data = this.sign(packet);
|
|
86
|
+
|
|
87
|
+
// Text data that is joined by line breaks and then trimmed.
|
|
88
|
+
this.state('set', `${data.key}:${data.method}:text:${data.id.uid}`); // set state to text for output formatting.
|
|
89
|
+
const text = [
|
|
90
|
+
'→',
|
|
91
|
+
`::BEGIN:${data.container}`,
|
|
92
|
+
`#${data.key}.${data.method}.${data.opts} ${data.text}`,
|
|
93
|
+
'\n---\n',
|
|
94
|
+
`sign:${data.client.fullname}${data.client.emojis}`,
|
|
95
|
+
'\n',
|
|
96
|
+
`::begin:${data.method}:${data.key}:${data.id.uid}`,
|
|
97
|
+
`transport: ${data.id.uid}`,
|
|
98
|
+
`time: ${data.time}`,
|
|
99
|
+
`expires: ${data.client.expires}`,
|
|
100
|
+
`name: ${data.client.name}`,
|
|
101
|
+
`fullname: ${data.client.fullname}`,
|
|
102
|
+
`company: ${data.client.company}`,
|
|
103
|
+
`caseid: ${data.client.caseid}`,
|
|
104
|
+
`client: ${data.client.sha256}`,
|
|
105
|
+
`agent: ${data.agent.sha256}`,
|
|
106
|
+
`token: ${data.client.token}`,
|
|
107
|
+
`warning: ${data.warning}`,
|
|
108
|
+
`created: ${data.created}`,
|
|
109
|
+
`copyright: ${data.copyright}`,
|
|
110
|
+
`md5: ${data.md5}`,
|
|
111
|
+
`sha256: ${data.sha256}`,
|
|
112
|
+
`sha512: ${data.sha512}`,
|
|
113
|
+
`::end:${data.method}:${data.key}:${data.id.uid}`,
|
|
114
|
+
`::END:${data.container}`,
|
|
115
|
+
].join('\n').trim();
|
|
116
|
+
|
|
117
|
+
// send the text data to #feecting to parse and return valid text, html, and data.
|
|
118
|
+
this.action('parse', `${data.key}:${data.method}:parse:${data.id.uid}`); // action set to feecting parse
|
|
119
|
+
const feecting = await this.question(`${this.askChr}feecting parse:${data.id.uid} ${text}`); // parse with feecting agent.
|
|
120
|
+
|
|
121
|
+
this.action('return', `${data.key}:${data.method}:${data.id.uid}`); // set the state to return proxy
|
|
122
|
+
return {
|
|
123
|
+
text: feecting.a.text,
|
|
124
|
+
html: feecting.a.html,
|
|
125
|
+
data,
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
},
|
|
129
|
+
|
|
76
130
|
/**************
|
|
77
131
|
method: md5, sha256, sha512 hash
|
|
78
132
|
params: packet
|
|
@@ -143,51 +197,4 @@ export default {
|
|
|
143
197
|
return Promise.resolve(theTime);
|
|
144
198
|
},
|
|
145
199
|
|
|
146
|
-
|
|
147
|
-
async sign(packet) {
|
|
148
|
-
const data = this.sign(packet);
|
|
149
|
-
|
|
150
|
-
// Text data that is joined by line breaks and then trimmed.
|
|
151
|
-
this.state('set', `${data.key}:${data.method}:text:${data.id.uid}`); // set state to text for output formatting.
|
|
152
|
-
const text = [
|
|
153
|
-
'→',
|
|
154
|
-
`::BEGIN:${data.container}`,
|
|
155
|
-
`#${data.key}.${data.method}.${data.opts} ${data.text}`,
|
|
156
|
-
'\n---\n',
|
|
157
|
-
`sign:${data.client.fullname}${data.client.emojis}`,
|
|
158
|
-
'\n',
|
|
159
|
-
`::begin:${data.method}:${data.key}:${data.id.uid}`,
|
|
160
|
-
`transport: ${data.id.uid}`,
|
|
161
|
-
`time: ${data.time}`,
|
|
162
|
-
`expires: ${data.client.expires}`,
|
|
163
|
-
`name: ${data.client.name}`,
|
|
164
|
-
`fullname: ${data.client.fullname}`,
|
|
165
|
-
`company: ${data.client.company}`,
|
|
166
|
-
`caseid: ${data.client.caseid}`,
|
|
167
|
-
`client: ${data.client.sha256}`,
|
|
168
|
-
`agent: ${data.agent.sha256}`,
|
|
169
|
-
`token: ${data.client.token}`,
|
|
170
|
-
`warning: ${data.warning}`,
|
|
171
|
-
`created: ${data.created}`,
|
|
172
|
-
`copyright: ${data.copyright}`,
|
|
173
|
-
`md5: ${data.md5}`,
|
|
174
|
-
`sha256: ${data.sha256}`,
|
|
175
|
-
`sha512: ${data.sha512}`,
|
|
176
|
-
`::end:${data.method}:${data.key}:${data.id.uid}`,
|
|
177
|
-
`::END:${data.container}`,
|
|
178
|
-
].join('\n').trim();
|
|
179
|
-
|
|
180
|
-
// send the text data to #feecting to parse and return valid text, html, and data.
|
|
181
|
-
this.action('parse', `${data.key}:${data.method}:parse:${data.id.uid}`); // action set to feecting parse
|
|
182
|
-
const feecting = await this.question(`${this.askChr}feecting parse:${data.id.uid} ${text}`); // parse with feecting agent.
|
|
183
|
-
|
|
184
|
-
this.action('return', `${data.key}:${data.method}:${data.id.uid}`); // set the state to return proxy
|
|
185
|
-
return {
|
|
186
|
-
text: feecting.a.text,
|
|
187
|
-
html: feecting.a.html,
|
|
188
|
-
data,
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
},
|
|
192
|
-
|
|
193
200
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "45249771785697968797",
|
|
3
3
|
"name": "@indra.ai/deva.security",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"license": "VLA:45249771785697968797 LICENSE.md",
|
|
6
6
|
"VLA": {
|
|
7
7
|
"uid": "45249771785697968797",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"homepage": "https://deva.space/devas/security",
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@indra.ai/deva": "^1.
|
|
63
|
+
"@indra.ai/deva": "^1.17.0",
|
|
64
64
|
"mongodb": "^6.20.0"
|
|
65
65
|
},
|
|
66
66
|
"data": {
|
|
@@ -106,8 +106,10 @@
|
|
|
106
106
|
"background": "/devas/security/background.png",
|
|
107
107
|
"owner": "Quinn A Michaels",
|
|
108
108
|
"creator": "Quinn A Michaels",
|
|
109
|
-
"
|
|
110
|
-
"
|
|
109
|
+
"status": "vedic",
|
|
110
|
+
"uid_warning": "⚠️ If a man, who subsists by the fulfilment of the law, departs from the established rule of the law, the Security Deva shall severely punish him by a fine, because he violated his duty.",
|
|
111
|
+
"copyright": "Copyright ©2025 Quinn Michaels. All rights reserved.",
|
|
112
|
+
"created": "Monday, May 22, 2023 at 9:26 AM"
|
|
111
113
|
}
|
|
112
114
|
},
|
|
113
115
|
"vars": {
|