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