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