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