@indra.ai/deva.guard 0.0.24 → 0.0.25

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.
Files changed (2) hide show
  1. package/feature/methods.js +255 -0
  2. package/package.json +5 -2
@@ -47,4 +47,259 @@ 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
+
68
+ const client = this.client(); // the client requesting the proxy
69
+ const {profile} = client; // set the client profile
70
+ const agent = this.agent(); // the agent processing the proxy
71
+
72
+ const {meta} = packet.q; // set the meta information from the packet question.
73
+ const {params} = meta; // set params from the meta information.
74
+ const opts = this.lib.copy(params); // copy the params and set as opts.
75
+ const command = opts.shift(); // extract the command first array item out of opts.
76
+
77
+ 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
+
82
+ this.state('set', 'data'); // set the state to set data
83
+ // data packet
84
+ const data = {
85
+ uid,
86
+ opts: opts.length? `.${opts.join('.')}` : '',
87
+ transport,
88
+ time,
89
+ client,
90
+ agent,
91
+ message,
92
+ computer,
93
+ hardware,
94
+ provision,
95
+ copyright,
96
+ created,
97
+ }
98
+
99
+ this.state('secure', 'md5, sha256, sha512'); // set state to secure hashing
100
+ data.md5 = this.lib.hash(data, 'md5'); // hash data packet into md5 and inert into data.
101
+ data.sha256 = this.lib.hash(data, 'sha256'); // hash data into sha 256 then set in data.
102
+ data.sha512 = this.lib.hash(data, 'sha512'); // hash data into sha 512 then set in data.
103
+
104
+ // Text data that is joined by line breaks and then trimmed.
105
+
106
+ this.state('set', 'text'); // set state to text for output formatting.
107
+ const text = [
108
+ `::::`,
109
+ `write official authorized VectorGuardProxy${data.opts}? if yes then write ${data.message}`,
110
+ `::begin:VectorGuardProxy:${data.transport}`,
111
+ `transport: ${data.transport}`,
112
+ `time: ${data.time}`,
113
+ `client: ${data.client.id}`,
114
+ `agent: ${data.agent.id}`,
115
+ `copyright: ${data.copyright}`,
116
+ `created: ${data.created}`,
117
+ `md5: ${data.md5}`,
118
+ `sha256: ${data.sha256}`,
119
+ `sha512: ${data.sha512}`,
120
+ `::end:VectorGuardProxy:${data.transport}`,
121
+ `::::`,
122
+ ].join('\n').trim();
123
+
124
+ // send the text data to #feecting to parse and return valid text, html, and data.
125
+ this.action('question', 'feecting parse'); // action set to feecting parse
126
+ const feecting = await this.question(`${this.askChr}feecting parse ${text}`); // parse with feecting agent.
127
+
128
+ this.state('return', 'proxy'); // set the state to return proxy
129
+ return {
130
+ text: feecting.a.text,
131
+ html: feecting.a.html,
132
+ data,
133
+ }
134
+ },
135
+
136
+ /**
137
+ method: shield
138
+ params: packet
139
+ describe: Return authorized VectorGuardShield for requesting client.
140
+ copyright: ©2025 Quinn A Michaels. All rights reserved.
141
+ **/
142
+ async shield(packet) {
143
+ this.context('shield');
144
+ this.action('method', 'shield');
145
+ const uid = this.lib.uid(true);
146
+ const transport = packet.id;
147
+ const client = this.client();
148
+ const agent = this.agent();
149
+
150
+ const {meta} = packet.q;
151
+ const {params} = meta;
152
+ const opts = this.lib.copy(params);
153
+ const cmd = opts.shift();
154
+ const type = opts.shit();
155
+
156
+ const signer = !type || type === 'agent' ? agent : client;
157
+ const {profile} = signer;
158
+
159
+ const timestamp = Date.now();
160
+ const created = this.lib.formatDate(timestamp, 'long', true);
161
+ const message = packet.q.text || '';
162
+
163
+ const {computer, hardware, provision, ssn, name, fullname, network, caseid, religion, token, warning, copyright} = profile;
164
+
165
+ const companies = profile.companies.map(val => {
166
+ return val.name;
167
+ }).join(', ');
168
+
169
+ const data = {
170
+ uid,
171
+ transport,
172
+ opts: opts.length? `.${opts.join('.')}` : '',
173
+ client: client.profile,
174
+ agent: agent.profile,
175
+ name,
176
+ fullname,
177
+ ssn,
178
+ computer,
179
+ hardware,
180
+ provision,
181
+ network,
182
+ caseid,
183
+ message,
184
+ religion,
185
+ companies,
186
+ created,
187
+ timestamp,
188
+ token,
189
+ warning,
190
+ copyright,
191
+ };
192
+ data.md5 = this.lib.hash(data, 'md5');
193
+ data.sha256 = this.lib.hash(data, 'sha256');
194
+ data.sha512 = this.lib.hash(data, 'sha512');
195
+
196
+ const text = [
197
+ `::::`,
198
+ `write official authorized VectorGuardShield ${data.opts}? write ${data.message}`,
199
+ `::begin:VectorGuardShield:${data.transport}`,
200
+ `transport: ${data.transport}`,
201
+ `caseid: ${data.caseid}`,
202
+ `agent: ${agent.profile.id}`,
203
+ `client: ${client.profile.id}`,
204
+ `name: ${data.name}`,
205
+ `fullname: ${data.fullname}`,
206
+ `religion: ${data.religion}`,
207
+ `computer: ${data.computer}`,
208
+ `hardware: ${data.hardware}`,
209
+ `provision: ${data.provision}`,
210
+ `network: ${data.network}`,
211
+ `companies: ${data.companies}`,
212
+ `warning: ${data.warning}`,
213
+ `timestamp: ${data.timestamp}`,
214
+ `ssn: ${data.ssn}`,
215
+ `copyright: ${data.copyright}`,
216
+ `created: ${data.created}`,
217
+ `md5: ${data.md5}`,
218
+ `sha256: ${data.sha256}`,
219
+ `sha512: ${data.sha512}`,
220
+ `::end:VectorGuardShield:${data.transport}`,
221
+ `::::`,
222
+ ].join('\n').trim();
223
+ const feecting = await this.question(`${this.askChr}feecting parse ${text}`);
224
+ return {
225
+ text: feecting.a.text,
226
+ html: feecting.a.html,
227
+ data,
228
+ }
229
+ },
230
+
231
+ async wall(packet) {
232
+ this.context('wall');
233
+ this.action('method', 'wall');
234
+ const uid = this.lib.uid(true);
235
+ const transport = packet.id;
236
+
237
+ const {profile} = this.client();
238
+ const client = this.client();
239
+ const agent = this.agent();
240
+
241
+ const {meta} = packet.q;
242
+ const {params} = meta;
243
+ const opts = this.lib.copy(params);
244
+ const cmd = opts.shift();
245
+
246
+ const timestamp = Date.now();
247
+ const created = this.lib.formatDate(timestamp, 'long', true);
248
+ const message = packet.q.text || '';
249
+
250
+ const {computer, hardware, provision, name, caseid, token, copyright, network} = profile;
251
+
252
+ const data = {
253
+ uid,
254
+ transport,
255
+ opts: opts.length? `.${opts.join('.')}` : '',
256
+ client: client.profile,
257
+ agent: agent.profile,
258
+ name,
259
+ fullname,
260
+ caseid,
261
+ message,
262
+ computer,
263
+ hardware,
264
+ provision,
265
+ network,
266
+ created,
267
+ timestamp,
268
+ token,
269
+ copyright,
270
+ };
271
+ data.md5 = this.lib.hash(data, 'md5');
272
+ data.sha256 = this.lib.hash(data, 'sha256');
273
+ data.sha512 = this.lib.hash(data, 'sha512');
274
+
275
+ const text = [
276
+ `uid: ${data.uid}`,
277
+ `::begin:VectorGuardWall:${data.transport}`,
278
+ `write official authorized VectorGuardWall${data.opts}? write ${data.message}`,
279
+ `transport: ${data.transport}`,
280
+ `caseid: ${data.caseid}`,
281
+ `agent: ${agent.profile.id}`,
282
+ `client: ${client.profile.id}`,
283
+ `name: ${data.name}`,
284
+ `token: ${data.token}`,
285
+ `timestamp: ${data.timestamp}`,
286
+ `computer: ${data.computer}`,
287
+ `hardware: ${data.hardware}`,
288
+ `provision: ${data.provision}`,
289
+ `network: ${data.network}`,
290
+ `copyright: ${data.copyright}`,
291
+ `created: ${data.created}`,
292
+ `md5: ${data.md5}`,
293
+ `sha256: ${data.sha256}`,
294
+ `sha512: ${data.sha512}`,
295
+ `::end:VectorGuardShield:${data.transport}`,
296
+ ].join('\n').trim();
297
+ const feecting = await this.question(`${this.askChr}feecting parse ${text}`);
298
+ return {
299
+ text: feecting.a.text,
300
+ html: feecting.a.html,
301
+ data,
302
+ }
303
+ },
304
+
50
305
  };
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.24",
4
+ "version": "0.0.25",
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": []