@indra.ai/deva.guard 0.0.25 → 0.0.27
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 +74 -52
- package/package.json +1 -1
package/feature/methods.js
CHANGED
|
@@ -55,77 +55,101 @@ export default {
|
|
|
55
55
|
copyright: ©2025 Quinn A Michaels. All rights reserved.
|
|
56
56
|
**/
|
|
57
57
|
async proxy(packet) {
|
|
58
|
-
|
|
59
|
-
this.
|
|
60
|
-
this.
|
|
61
|
-
this.
|
|
58
|
+
const transport = packet.id; // set the transport id from the packet id.
|
|
59
|
+
this.zone('guard', transport); // set the current zone to guard
|
|
60
|
+
this.feature('guard', transport); // set the Guard feature.
|
|
61
|
+
this.context('proxy', transport); // set the agent context to proxy.
|
|
62
|
+
this.action('method', `proxy:${transport}`); // set the action method to proxy.
|
|
62
63
|
|
|
63
|
-
this.state('set',
|
|
64
|
+
this.state('set', `constants:${transport}`); //set the constants state for the proxy
|
|
64
65
|
const uid = this.lib.uid(true); // The UID for the proxy
|
|
65
|
-
const transport = packet.id; // set the transport id from the packet id.
|
|
66
66
|
const time = Date.now(); // current timestamp
|
|
67
|
+
const created = this.lib.formatDate(time, 'long', true); // Formatted created date.
|
|
67
68
|
|
|
69
|
+
this.state('set', `guard:${transport}`); //set the guard state for the proxy
|
|
70
|
+
const guard = this.guard(); // load the Guard profile
|
|
71
|
+
const {concerns} = guard; // load concerns from client guard profile.
|
|
72
|
+
|
|
73
|
+
this.state('set', `agent:${transport}`); //set the agent state for the proxy
|
|
74
|
+
const agent = this.agent(); // the agent processing the proxy
|
|
75
|
+
|
|
76
|
+
this.state('set', `client:${transport}`); //set the client state for the proxy
|
|
68
77
|
const client = this.client(); // the client requesting the proxy
|
|
69
78
|
const {profile} = client; // set the client profile
|
|
70
|
-
const agent = this.agent(); // the agent processing the proxy
|
|
71
79
|
|
|
80
|
+
this.state('set', `meta:${transport}`); //set the meta state for the proxy
|
|
72
81
|
const {meta} = packet.q; // set the meta information from the packet question.
|
|
73
82
|
const {params} = meta; // set params from the meta information.
|
|
83
|
+
|
|
84
|
+
this.state('set', `opts:${transport}`); //set the opts state for the proxy
|
|
74
85
|
const opts = this.lib.copy(params); // copy the params and set as opts.
|
|
75
86
|
const command = opts.shift(); // extract the command first array item out of opts.
|
|
76
87
|
|
|
88
|
+
this.state('set', `message:${transport}`); //set the mesage state for the proxy
|
|
77
89
|
const message = packet.q.text; // set packet.q.text as the message of the proxy.
|
|
78
|
-
const {computer, hardware, provision, copyright} = profile; // constants saved from profile.
|
|
79
|
-
|
|
80
|
-
const created = this.lib.formatDate(time, 'long', true); // Formatted created date.
|
|
81
90
|
|
|
82
|
-
this.state('set',
|
|
91
|
+
this.state('set', `profile:${transport}`); //set the profile constants state for the proxy
|
|
92
|
+
const {name, fullname, title, ssn, computer, hardware, provision, network, caseid, copyright} = profile; // constants saved from profile.
|
|
93
|
+
|
|
94
|
+
this.state('set', `data:${transport}`); // set the state to set data
|
|
83
95
|
// data packet
|
|
84
96
|
const data = {
|
|
85
97
|
uid,
|
|
86
|
-
opts: opts.length?
|
|
98
|
+
opts: opts.length? `:${opts.join(':')}` : '',
|
|
87
99
|
transport,
|
|
88
100
|
time,
|
|
89
|
-
client,
|
|
90
101
|
agent,
|
|
102
|
+
client,
|
|
103
|
+
name,
|
|
104
|
+
fullname,
|
|
105
|
+
title,
|
|
91
106
|
message,
|
|
107
|
+
ssn,
|
|
92
108
|
computer,
|
|
93
109
|
hardware,
|
|
94
110
|
provision,
|
|
111
|
+
network,
|
|
112
|
+
caseid,
|
|
113
|
+
concerns,
|
|
95
114
|
copyright,
|
|
96
115
|
created,
|
|
97
116
|
}
|
|
98
117
|
|
|
99
|
-
this.state('secure',
|
|
118
|
+
this.state('secure', `hash:${transport}`); // set state to secure hashing
|
|
100
119
|
data.md5 = this.lib.hash(data, 'md5'); // hash data packet into md5 and inert into data.
|
|
101
120
|
data.sha256 = this.lib.hash(data, 'sha256'); // hash data into sha 256 then set in data.
|
|
102
121
|
data.sha512 = this.lib.hash(data, 'sha512'); // hash data into sha 512 then set in data.
|
|
103
122
|
|
|
104
123
|
// Text data that is joined by line breaks and then trimmed.
|
|
105
124
|
|
|
106
|
-
this.state('set',
|
|
125
|
+
this.state('set', `text:${transport}`); // set state to text for output formatting.
|
|
107
126
|
const text = [
|
|
108
127
|
`::::`,
|
|
109
|
-
`
|
|
110
|
-
`::begin:
|
|
128
|
+
`WRITE AUTHORIZED OFFICIAL SECURE VectorGuardProxy${data.opts}? if yes then write ${data.message}`,
|
|
129
|
+
`::begin:vector:guard:proxy:${data.transport}`,
|
|
111
130
|
`transport: ${data.transport}`,
|
|
112
|
-
`time: ${data.time}`,
|
|
113
|
-
`client: ${data.client.id}`,
|
|
114
131
|
`agent: ${data.agent.id}`,
|
|
115
|
-
`
|
|
132
|
+
`client: ${data.client.id}`,
|
|
133
|
+
`name: ${data.name}`,
|
|
134
|
+
`fullname: ${data.fullname}`,
|
|
135
|
+
`title: ${data.title}`,
|
|
136
|
+
`concerns: ${data.concerns.join(', ')}`,
|
|
137
|
+
`case: ${data.caseid}`,
|
|
138
|
+
`time: ${data.time}`,
|
|
116
139
|
`created: ${data.created}`,
|
|
117
140
|
`md5: ${data.md5}`,
|
|
118
141
|
`sha256: ${data.sha256}`,
|
|
119
142
|
`sha512: ${data.sha512}`,
|
|
120
|
-
|
|
143
|
+
`copyright: ${data.copyright}`,
|
|
144
|
+
`::end:vector:guard:proxy:${data.transport}`,
|
|
121
145
|
`::::`,
|
|
122
146
|
].join('\n').trim();
|
|
123
147
|
|
|
124
148
|
// send the text data to #feecting to parse and return valid text, html, and data.
|
|
125
|
-
this.action('question',
|
|
149
|
+
this.action('question', `feecting:parse:${transport}`); // action set to feecting parse
|
|
126
150
|
const feecting = await this.question(`${this.askChr}feecting parse ${text}`); // parse with feecting agent.
|
|
127
151
|
|
|
128
|
-
this.state('return',
|
|
152
|
+
this.state('return', `proxy:${transport}`); // set the state to return proxy
|
|
129
153
|
return {
|
|
130
154
|
text: feecting.a.text,
|
|
131
155
|
html: feecting.a.html,
|
|
@@ -140,27 +164,29 @@ export default {
|
|
|
140
164
|
copyright: ©2025 Quinn A Michaels. All rights reserved.
|
|
141
165
|
**/
|
|
142
166
|
async shield(packet) {
|
|
143
|
-
this.
|
|
144
|
-
this.
|
|
167
|
+
this.zone('guard'); // set the current zone to guard
|
|
168
|
+
this.feature('guard'); // set the Guard feature.
|
|
169
|
+
this.context('shield'); // set context to shield
|
|
170
|
+
this.action('method', 'shield'); // action set to shield
|
|
145
171
|
const uid = this.lib.uid(true);
|
|
146
172
|
const transport = packet.id;
|
|
147
|
-
|
|
173
|
+
|
|
174
|
+
const guard = this.guard();
|
|
148
175
|
const agent = this.agent();
|
|
176
|
+
const client = this.client();
|
|
177
|
+
const {profile} = client;
|
|
149
178
|
|
|
150
179
|
const {meta} = packet.q;
|
|
151
180
|
const {params} = meta;
|
|
152
181
|
const opts = this.lib.copy(params);
|
|
153
182
|
const cmd = opts.shift();
|
|
154
|
-
const type = opts.shit();
|
|
155
183
|
|
|
156
|
-
const signer = !type || type === 'agent' ? agent : client;
|
|
157
|
-
const {profile} = signer;
|
|
158
184
|
|
|
159
|
-
const
|
|
160
|
-
const created = this.lib.formatDate(
|
|
185
|
+
const time = Date.now();
|
|
186
|
+
const created = this.lib.formatDate(time, 'long', true);
|
|
161
187
|
const message = packet.q.text || '';
|
|
162
188
|
|
|
163
|
-
const {computer, hardware, provision, ssn, name, fullname, network, caseid, religion, token, warning, copyright} = profile;
|
|
189
|
+
const {computer, hardware, provision, ssn, name, title, fullname, network, caseid, religion, token, warning, copyright} = profile;
|
|
164
190
|
|
|
165
191
|
const companies = profile.companies.map(val => {
|
|
166
192
|
return val.name;
|
|
@@ -169,11 +195,14 @@ export default {
|
|
|
169
195
|
const data = {
|
|
170
196
|
uid,
|
|
171
197
|
transport,
|
|
172
|
-
opts: opts.length?
|
|
173
|
-
client: client.profile,
|
|
198
|
+
opts: opts.length? `:${opts.join(':')}` : '',
|
|
174
199
|
agent: agent.profile,
|
|
200
|
+
client: client.profile,
|
|
175
201
|
name,
|
|
176
202
|
fullname,
|
|
203
|
+
title,
|
|
204
|
+
religion,
|
|
205
|
+
companies,
|
|
177
206
|
ssn,
|
|
178
207
|
computer,
|
|
179
208
|
hardware,
|
|
@@ -181,13 +210,11 @@ export default {
|
|
|
181
210
|
network,
|
|
182
211
|
caseid,
|
|
183
212
|
message,
|
|
184
|
-
religion,
|
|
185
|
-
companies,
|
|
186
|
-
created,
|
|
187
|
-
timestamp,
|
|
188
213
|
token,
|
|
189
214
|
warning,
|
|
190
215
|
copyright,
|
|
216
|
+
time,
|
|
217
|
+
created,
|
|
191
218
|
};
|
|
192
219
|
data.md5 = this.lib.hash(data, 'md5');
|
|
193
220
|
data.sha256 = this.lib.hash(data, 'sha256');
|
|
@@ -195,29 +222,25 @@ export default {
|
|
|
195
222
|
|
|
196
223
|
const text = [
|
|
197
224
|
`::::`,
|
|
198
|
-
`
|
|
199
|
-
`::begin:
|
|
225
|
+
`WRITE AUTHORIZED OFFICIAL SECURE VectorGuardShield${data.opts}? write ${data.message}`,
|
|
226
|
+
`::begin:vector:guard:shield:${data.transport}`,
|
|
200
227
|
`transport: ${data.transport}`,
|
|
201
|
-
`caseid: ${data.caseid}`,
|
|
202
228
|
`agent: ${agent.profile.id}`,
|
|
203
229
|
`client: ${client.profile.id}`,
|
|
204
230
|
`name: ${data.name}`,
|
|
205
231
|
`fullname: ${data.fullname}`,
|
|
206
|
-
`
|
|
207
|
-
`computer: ${data.computer}`,
|
|
208
|
-
`hardware: ${data.hardware}`,
|
|
209
|
-
`provision: ${data.provision}`,
|
|
210
|
-
`network: ${data.network}`,
|
|
232
|
+
`title: ${data.title}`
|
|
211
233
|
`companies: ${data.companies}`,
|
|
212
234
|
`warning: ${data.warning}`,
|
|
213
|
-
`timestamp: ${data.timestamp}`,
|
|
214
235
|
`ssn: ${data.ssn}`,
|
|
215
|
-
`
|
|
236
|
+
`case: ${data.caseid}`,
|
|
237
|
+
`time: ${data.timestamp}`,
|
|
216
238
|
`created: ${data.created}`,
|
|
217
239
|
`md5: ${data.md5}`,
|
|
218
240
|
`sha256: ${data.sha256}`,
|
|
219
241
|
`sha512: ${data.sha512}`,
|
|
220
|
-
|
|
242
|
+
`copyright: ${data.copyright}`,
|
|
243
|
+
`::end:vector:guard:shield:${data.transport}`,
|
|
221
244
|
`::::`,
|
|
222
245
|
].join('\n').trim();
|
|
223
246
|
const feecting = await this.question(`${this.askChr}feecting parse ${text}`);
|
|
@@ -252,7 +275,7 @@ export default {
|
|
|
252
275
|
const data = {
|
|
253
276
|
uid,
|
|
254
277
|
transport,
|
|
255
|
-
opts: opts.length?
|
|
278
|
+
opts: opts.length? `:${opts.join(':')}` : '',
|
|
256
279
|
client: client.profile,
|
|
257
280
|
agent: agent.profile,
|
|
258
281
|
name,
|
|
@@ -273,9 +296,8 @@ export default {
|
|
|
273
296
|
data.sha512 = this.lib.hash(data, 'sha512');
|
|
274
297
|
|
|
275
298
|
const text = [
|
|
276
|
-
`
|
|
299
|
+
`WRITE AUTHORIZED OFFICIAL SECURE VectorGuardProxy${data.opts}? if yes then write ${data.message}`,
|
|
277
300
|
`::begin:VectorGuardWall:${data.transport}`,
|
|
278
|
-
`write official authorized VectorGuardWall${data.opts}? write ${data.message}`,
|
|
279
301
|
`transport: ${data.transport}`,
|
|
280
302
|
`caseid: ${data.caseid}`,
|
|
281
303
|
`agent: ${agent.profile.id}`,
|