@indra.ai/deva.guard 0.0.27 → 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 +94 -47
- package/package.json +1 -1
package/feature/methods.js
CHANGED
|
@@ -55,15 +55,19 @@ export default {
|
|
|
55
55
|
copyright: ©2025 Quinn A Michaels. All rights reserved.
|
|
56
56
|
**/
|
|
57
57
|
async proxy(packet) {
|
|
58
|
+
this.state('set', `transport:${packet.id}`);
|
|
58
59
|
const transport = packet.id; // set the transport id from the packet id.
|
|
60
|
+
|
|
59
61
|
this.zone('guard', transport); // set the current zone to guard
|
|
60
62
|
this.feature('guard', transport); // set the Guard feature.
|
|
61
63
|
this.context('proxy', transport); // set the agent context to proxy.
|
|
62
64
|
this.action('method', `proxy:${transport}`); // set the action method to proxy.
|
|
63
|
-
|
|
64
|
-
this.state('set', `
|
|
65
|
+
|
|
66
|
+
this.state('set', `uid:${transport}`); //set the uid state for the proxy
|
|
65
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
73
|
this.state('set', `guard:${transport}`); //set the guard state for the proxy
|
|
@@ -83,26 +87,31 @@ export default {
|
|
|
83
87
|
|
|
84
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', `message:${transport}`); //set the
|
|
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
97
|
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.
|
|
98
|
+
const {name, fullname, title, religion, companies, ssn, emojis, computer, hardware, provision, network, caseid, token, copyright} = profile; // constants saved from profile.
|
|
93
99
|
|
|
94
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,
|
|
107
116
|
ssn,
|
|
108
117
|
computer,
|
|
@@ -111,28 +120,35 @@ export default {
|
|
|
111
120
|
network,
|
|
112
121
|
caseid,
|
|
113
122
|
concerns,
|
|
123
|
+
token,
|
|
114
124
|
copyright,
|
|
115
125
|
created,
|
|
116
126
|
}
|
|
117
127
|
|
|
118
|
-
this.state('secure', `
|
|
128
|
+
this.state('secure', `md5:${transport}`); // set state to secure hashing
|
|
119
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
|
|
120
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
|
|
121
135
|
data.sha512 = this.lib.hash(data, 'sha512'); // hash data into sha 512 then set in data.
|
|
122
136
|
|
|
123
137
|
// Text data that is joined by line breaks and then trimmed.
|
|
124
138
|
|
|
125
139
|
this.state('set', `text:${transport}`); // set state to text for output formatting.
|
|
126
140
|
const text = [
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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}`,
|
|
130
145
|
`transport: ${data.transport}`,
|
|
131
146
|
`agent: ${data.agent.id}`,
|
|
132
147
|
`client: ${data.client.id}`,
|
|
133
148
|
`name: ${data.name}`,
|
|
134
149
|
`fullname: ${data.fullname}`,
|
|
135
150
|
`title: ${data.title}`,
|
|
151
|
+
`token: ${data.token}`,
|
|
136
152
|
`concerns: ${data.concerns.join(', ')}`,
|
|
137
153
|
`case: ${data.caseid}`,
|
|
138
154
|
`time: ${data.time}`,
|
|
@@ -141,13 +157,13 @@ export default {
|
|
|
141
157
|
`sha256: ${data.sha256}`,
|
|
142
158
|
`sha512: ${data.sha512}`,
|
|
143
159
|
`copyright: ${data.copyright}`,
|
|
144
|
-
`::end:vector:guard:proxy:${data.
|
|
145
|
-
|
|
160
|
+
`::end:vector:guard:proxy:${data.md5}`,
|
|
161
|
+
`::END:MAIN:${transport}:${data.emojis}`,
|
|
146
162
|
].join('\n').trim();
|
|
147
163
|
|
|
148
164
|
// send the text data to #feecting to parse and return valid text, html, and data.
|
|
149
165
|
this.action('question', `feecting:parse:${transport}`); // action set to feecting parse
|
|
150
|
-
const feecting = await this.question(`${this.askChr}feecting parse ${text}`); // parse with feecting agent.
|
|
166
|
+
const feecting = await this.question(`${this.askChr}feecting parse:${transport} ${text}`); // parse with feecting agent.
|
|
151
167
|
|
|
152
168
|
this.state('return', `proxy:${transport}`); // set the state to return proxy
|
|
153
169
|
return {
|
|
@@ -164,34 +180,49 @@ export default {
|
|
|
164
180
|
copyright: ©2025 Quinn A Michaels. All rights reserved.
|
|
165
181
|
**/
|
|
166
182
|
async shield(packet) {
|
|
167
|
-
this.
|
|
168
|
-
|
|
169
|
-
this.context('shield'); // set context to shield
|
|
170
|
-
this.action('method', 'shield'); // action set to shield
|
|
171
|
-
const uid = this.lib.uid(true);
|
|
172
|
-
const transport = packet.id;
|
|
183
|
+
this.state('set', `transport:${packet.id}`);
|
|
184
|
+
const transport = packet.id; // set the transport from packet.id
|
|
173
185
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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.
|
|
178
201
|
|
|
179
|
-
|
|
180
|
-
const
|
|
181
|
-
const opts = this.lib.copy(params);
|
|
182
|
-
const cmd = opts.shift();
|
|
202
|
+
this.state('set', `agent:${transport}`); //set the agent state for the proxy
|
|
203
|
+
const agent = this.agent(); // the agent processing the proxy
|
|
183
204
|
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
const
|
|
187
|
-
const message = packet.q.text || '';
|
|
188
|
-
|
|
189
|
-
const {computer, hardware, provision, ssn, name, title, 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
|
|
190
208
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
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.
|
|
194
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
|
|
195
226
|
const data = {
|
|
196
227
|
uid,
|
|
197
228
|
transport,
|
|
@@ -201,6 +232,7 @@ export default {
|
|
|
201
232
|
name,
|
|
202
233
|
fullname,
|
|
203
234
|
title,
|
|
235
|
+
emojis,
|
|
204
236
|
religion,
|
|
205
237
|
companies,
|
|
206
238
|
ssn,
|
|
@@ -216,23 +248,29 @@ export default {
|
|
|
216
248
|
time,
|
|
217
249
|
created,
|
|
218
250
|
};
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
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.
|
|
222
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.
|
|
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.
|
|
223
262
|
const text = [
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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}`,
|
|
227
267
|
`transport: ${data.transport}`,
|
|
228
268
|
`agent: ${agent.profile.id}`,
|
|
229
269
|
`client: ${client.profile.id}`,
|
|
230
270
|
`name: ${data.name}`,
|
|
231
271
|
`fullname: ${data.fullname}`,
|
|
232
|
-
`title: ${data.title}
|
|
233
|
-
`companies: ${data.companies}`,
|
|
272
|
+
`title: ${data.title}`,
|
|
234
273
|
`warning: ${data.warning}`,
|
|
235
|
-
`ssn: ${data.ssn}`,
|
|
236
274
|
`case: ${data.caseid}`,
|
|
237
275
|
`time: ${data.timestamp}`,
|
|
238
276
|
`created: ${data.created}`,
|
|
@@ -240,10 +278,16 @@ export default {
|
|
|
240
278
|
`sha256: ${data.sha256}`,
|
|
241
279
|
`sha512: ${data.sha512}`,
|
|
242
280
|
`copyright: ${data.copyright}`,
|
|
243
|
-
`::end:vector:guard:shield:${data.
|
|
244
|
-
|
|
281
|
+
`::end:vector:guard:shield:${data.md5}`,
|
|
282
|
+
`::END:MAIN:${transport}:${data.emojis}`,
|
|
283
|
+
'::::',
|
|
245
284
|
].join('\n').trim();
|
|
246
|
-
|
|
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
|
|
247
291
|
return {
|
|
248
292
|
text: feecting.a.text,
|
|
249
293
|
html: feecting.a.html,
|
|
@@ -316,6 +360,9 @@ export default {
|
|
|
316
360
|
`sha512: ${data.sha512}`,
|
|
317
361
|
`::end:VectorGuardShield:${data.transport}`,
|
|
318
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
|
|
319
366
|
const feecting = await this.question(`${this.askChr}feecting parse ${text}`);
|
|
320
367
|
return {
|
|
321
368
|
text: feecting.a.text,
|