@indra.ai/deva.guard 0.0.28 → 0.0.30

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 +175 -103
  2. package/package.json +2 -2
@@ -79,10 +79,11 @@ export default {
79
79
 
80
80
  this.state('set', `client:${transport}`); //set the client state for the proxy
81
81
  const client = this.client(); // the client requesting the proxy
82
- const {profile} = client; // set the client profile
83
82
 
84
83
  this.state('set', `meta:${transport}`); //set the meta state for the proxy
85
84
  const {meta} = packet.q; // set the meta information from the packet question.
85
+
86
+ this.state('set', `params:${transport}`); //set the meta state for the proxy
86
87
  const {params} = meta; // set params from the meta information.
87
88
 
88
89
  this.state('set', `opts:${transport}`); //set the opts state for the proxy
@@ -93,37 +94,42 @@ export default {
93
94
 
94
95
  this.state('set', `message:${transport}`); //set the message state for the proxy
95
96
  const message = packet.q.text; // set packet.q.text as the message of the proxy.
96
-
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.
97
+
98
+ this.state('set', `write:${transport}`); //set the message state for the proxy
99
+ const write = `OM:${client.profile.write.split(' ').join(':').toUpperCase()}:PROXY`; // set proxy write string.
99
100
 
100
101
  this.state('set', `data:${transport}`); // set the state to set data
101
102
  // data packet
102
103
  const data = {
103
104
  uid,
105
+ message,
106
+ time,
104
107
  transport,
108
+ write,
109
+ case: client.profile.caseid,
105
110
  opts: opts.length? `:${opts.join(':')}` : '',
106
- time,
107
- agent,
108
- client,
109
- name,
110
- fullname,
111
- title,
112
- emojis,
113
- religion,
114
- companies,
115
- message,
116
- ssn,
117
- computer,
118
- hardware,
119
- provision,
120
- network,
121
- caseid,
111
+ agent: agent.profile,
112
+ client: client.profile,
113
+ name: client.profile.name,
114
+ fullname: client.profile.fullname,
115
+ nickname: client.profile.nickname,
116
+ birthname: client.profile.birthname,
117
+ gender: client.profile.gender,
118
+ pronouns: client.profile.pronouns,
119
+ emojis: client.profile.emojis,
120
+ company: client.profile.company,
121
+ address: `${client.profile.address} ${client.profile.city} ${client.profile.state} ${client.profile.zipcode}`,
122
+ family: client.profile.family,
123
+ friends: client.profile.friends,
124
+ token: client.profile.token,
125
+ warning: client.profile.warning,
122
126
  concerns,
123
- token,
124
- copyright,
127
+ meta,
128
+ params,
129
+ command,
125
130
  created,
126
- }
131
+ copyright: client.profile.copyright,
132
+ };
127
133
 
128
134
  this.state('secure', `md5:${transport}`); // set state to secure hashing
129
135
  data.md5 = this.lib.hash(data, 'md5'); // hash data packet into md5 and inert into data.
@@ -133,32 +139,38 @@ export default {
133
139
 
134
140
  this.state('secure', `sha512:${transport}`); // set state to secure hashing
135
141
  data.sha512 = this.lib.hash(data, 'sha512'); // hash data into sha 512 then set in data.
136
-
142
+
137
143
  // Text data that is joined by line breaks and then trimmed.
138
-
139
144
  this.state('set', `text:${transport}`); // set state to text for output formatting.
140
145
  const text = [
141
146
  `:::`,
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}`,
147
+ `::BEGIN:${data.write}:${data.transport}`,
148
+ `#VectorGuardProxy${data.opts} ${data.message}`,
149
+ `::begin:vector:guard:proxy:${transport}:${data.emojis}`,
150
+ `time: ${data.time}`,
145
151
  `transport: ${data.transport}`,
146
152
  `agent: ${data.agent.id}`,
147
153
  `client: ${data.client.id}`,
148
154
  `name: ${data.name}`,
149
155
  `fullname: ${data.fullname}`,
150
- `title: ${data.title}`,
156
+ `nickname: ${data.nickname}`,
157
+ `family: ${data.family}`,
158
+ `friends: ${data.friends}`,
159
+ `gender: ${data.gender}`,
160
+ `pronouns: ${data.pronouns}`,
161
+ `company: ${data.company}`,
162
+ `address: ${data.address}`,
151
163
  `token: ${data.token}`,
152
- `concerns: ${data.concerns.join(', ')}`,
153
- `case: ${data.caseid}`,
154
- `time: ${data.time}`,
164
+ `concerns: ${data.concerns}`,
165
+ `warning: ${data.warning}`,
166
+ `caseid: ${data.caseid}`,
155
167
  `created: ${data.created}`,
156
168
  `md5: ${data.md5}`,
157
169
  `sha256: ${data.sha256}`,
158
170
  `sha512: ${data.sha512}`,
159
171
  `copyright: ${data.copyright}`,
160
- `::end:vector:guard:proxy:${data.md5}`,
161
- `::END:MAIN:${transport}:${data.emojis}`,
172
+ `::end:vector:guard:proxy:${data.transport}:${data.emojis}`,
173
+ `::END:${data.write}:${data.transport}`,
162
174
  ].join('\n').trim();
163
175
 
164
176
  // send the text data to #feecting to parse and return valid text, html, and data.
@@ -219,34 +231,42 @@ export default {
219
231
  this.state('set', `message:${transport}`); //set the message state for the proxy
220
232
  const message = packet.q.text; // set packet.q.text as the message of the proxy.
221
233
 
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;
234
+ this.state('set', `writestr:${transport}`);
235
+ const write = `OM:${client.profile.write.split(' ').join(':').toUpperCase()}:SHIELD`;
224
236
 
225
- this.state('set', `data:${transport}`); // set the state to set data
237
+ this.state('hash', `profile:${transport}`);
238
+ const profile = this.lib.hash(client.profile, 'sha256');
239
+ this.state('set', `data:${transport}`); // set the state to set data
240
+ // data packet
226
241
  const data = {
227
242
  uid,
243
+ message,
244
+ time,
228
245
  transport,
246
+ write,
247
+ case: client.profile.caseid,
229
248
  opts: opts.length? `:${opts.join(':')}` : '',
230
249
  agent: agent.profile,
231
250
  client: client.profile,
232
- name,
233
- fullname,
234
- title,
235
- emojis,
236
- religion,
237
- companies,
238
- ssn,
239
- computer,
240
- hardware,
241
- provision,
242
- network,
243
- caseid,
244
- message,
245
- token,
246
- warning,
247
- copyright,
248
- time,
251
+ name: client.profile.name,
252
+ fullname: client.profile.fullname,
253
+ nickname: client.profile.nickname,
254
+ birthname: client.profile.birthname,
255
+ gender: client.profile.gender,
256
+ pronouns: client.profile.pronouns,
257
+ emojis: client.profile.emojis,
258
+ company: client.profile.company,
259
+ address: `${client.profile.address} ${client.profile.city} ${client.profile.state} ${client.profile.zipcode}`,
260
+ family: client.profile.family,
261
+ friends: client.profile.friends,
262
+ token: client.profile.token,
263
+ warning: client.profile.warning,
264
+ concerns,
265
+ meta,
266
+ params,
267
+ command,
249
268
  created,
269
+ copyright: client.profile.copyright,
250
270
  };
251
271
 
252
272
  this.state('secure', `md5:${transport}`); // set state to secure hashing
@@ -257,29 +277,37 @@ export default {
257
277
 
258
278
  this.state('secure', `sha512:${transport}`); // set state to secure hashing
259
279
  data.sha512 = this.lib.hash(data, 'sha512'); // hash data into sha 512 then set in data.
260
-
280
+
261
281
  this.state('set', `text:${transport}`); // set state to text for output formatting.
262
282
  const text = [
263
283
  '::::',
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}`,
284
+ `::BEGIN:${data.write}:${transport}`,
285
+ `#VectorGuardShield${data.opts} ${data.message}`,
286
+ `::begin:vector:guard:shield:${transport}:${data.emojis}`,
287
+ `time: ${data.time}`,
267
288
  `transport: ${data.transport}`,
268
- `agent: ${agent.profile.id}`,
269
- `client: ${client.profile.id}`,
289
+ `agent: ${data.agent.id}`,
290
+ `client: ${data.client.id}`,
270
291
  `name: ${data.name}`,
271
292
  `fullname: ${data.fullname}`,
272
- `title: ${data.title}`,
293
+ `nickname: ${data.nickname}`,
294
+ `family: ${data.family}`,
295
+ `friends: ${data.friends}`,
296
+ `gender: ${data.gender}`,
297
+ `pronouns: ${data.pronouns}`,
298
+ `company: ${data.company}`,
299
+ `address: ${data.address}`,
300
+ `token: ${data.token}`,
301
+ `concerns: ${data.concerns}`,
273
302
  `warning: ${data.warning}`,
274
- `case: ${data.caseid}`,
275
- `time: ${data.timestamp}`,
303
+ `caseid: ${data.caseid}`,
276
304
  `created: ${data.created}`,
277
305
  `md5: ${data.md5}`,
278
306
  `sha256: ${data.sha256}`,
279
307
  `sha512: ${data.sha512}`,
280
308
  `copyright: ${data.copyright}`,
281
- `::end:vector:guard:shield:${data.md5}`,
282
- `::END:MAIN:${transport}:${data.emojis}`,
309
+ `::end:vector:guard:shield:${data.transport}:${data.emojis}`,
310
+ `::END:${data.write}:${transport}`,
283
311
  '::::',
284
312
  ].join('\n').trim();
285
313
 
@@ -296,69 +324,113 @@ export default {
296
324
  },
297
325
 
298
326
  async wall(packet) {
299
- this.context('wall');
300
- this.action('method', 'wall');
301
- const uid = this.lib.uid(true);
302
- const transport = packet.id;
303
-
304
- const {profile} = this.client();
305
- const client = this.client();
306
- const agent = this.agent();
307
-
308
- const {meta} = packet.q;
309
- const {params} = meta;
310
- const opts = this.lib.copy(params);
311
- const cmd = opts.shift();
312
-
313
- const timestamp = Date.now();
314
- const created = this.lib.formatDate(timestamp, 'long', true);
315
- const message = packet.q.text || '';
316
-
317
- const {computer, hardware, provision, name, caseid, token, copyright, network} = profile;
327
+ this.state('set', `transport:${packet.id}`);
328
+ const transport = packet.id; // set the transport from packet.id
329
+
330
+ this.zone('wall', transport); // set the current zone to wall
331
+ this.feature('wall', transport); // set the Wall feature.
332
+ this.context('wall', transport); // set context to shield
333
+ this.action('method', `wall:${transport}`); // action set to shield
334
+
335
+ this.state('set', `uid:${transport}`); //set the uid state for the proxy
336
+ const uid = this.lib.uid(true); // The UID for the proxy
337
+ this.state('set', `time:${transport}`); //set the time state for the proxy
338
+ const time = Date.now(); // current timestamp
339
+ this.state('created', `created:${transport}`); //set the uid state for the proxy
340
+ const created = this.lib.formatDate(time, 'long', true); // Formatted created date.
341
+
342
+ this.state('set', `wall:${transport}`); //set the wall state for the proxy
343
+ const guard = this.guard(); // load the Guard profile
344
+ const {concerns} = guard; // load concerns from client guard profile.
345
+
346
+ this.state('set', `agent:${transport}`); //set the agent state for the proxy
347
+ const agent = this.agent(); // the agent processing the proxy
348
+
349
+ this.state('set', `client:${transport}`); //set the client state for the proxy
350
+ const client = this.client(); // the client requesting the proxy
351
+ const {profile} = client; // set the client profile
352
+
353
+ this.state('set', `meta:${transport}`); //set the meta state for the proxy
354
+ const {meta} = packet.q; // set the meta information from the packet question.
355
+ const {params} = meta; // set params from the meta information.
356
+
357
+ this.state('set', `opts:${transport}`); //set the opts state for the proxy
358
+ const opts = this.lib.copy(params); // copy the params and set as opts.
359
+
360
+ this.state('set', `command:${transport}`); //set the opts state for the proxy
361
+ const command = opts.shift(); // extract the command first array item out of opts.
362
+
363
+ this.state('set', `message:${transport}`); //set the message state for the proxy
364
+ const message = packet.q.text; // set packet.q.text as the message of the proxy.
318
365
 
366
+ this.state('set', `profile:${transport}`); //set the profile constants state for the proxy
367
+ const {name, fullname, nickname, title, write, religion, companies, ssn, emojis, warning, computer, hardware, provision, network, caseid, token, copyright} = profile; // constants saved from profile.
368
+
369
+ this.state('set', `data:${transport}`); // set the state to set data
370
+ // data packet
319
371
  const data = {
320
372
  uid,
321
373
  transport,
322
374
  opts: opts.length? `:${opts.join(':')}` : '',
323
- client: client.profile,
324
- agent: agent.profile,
375
+ time,
376
+ agent,
377
+ client,
325
378
  name,
326
379
  fullname,
327
- caseid,
328
- message,
380
+ nickname,
381
+ title,
382
+ write,
383
+ emojis,
384
+ warning,
385
+ religion,
386
+ companies,
387
+ message,
388
+ ssn,
329
389
  computer,
330
- hardware,
390
+ hardware,
331
391
  provision,
332
392
  network,
333
- created,
334
- timestamp,
393
+ caseid,
394
+ concerns,
335
395
  token,
336
396
  copyright,
397
+ created,
337
398
  };
338
- data.md5 = this.lib.hash(data, 'md5');
339
- data.sha256 = this.lib.hash(data, 'sha256');
340
- data.sha512 = this.lib.hash(data, 'sha512');
399
+
400
+ this.state('secure', `md5:${transport}`); // set state to secure hashing
401
+ data.md5 = this.lib.hash(data, 'md5'); // hash data packet into md5 and inert into data.
341
402
 
403
+ this.state('secure', `sha256:${transport}`); // set state to secure hashing
404
+ data.sha256 = this.lib.hash(data, 'sha256'); // hash data into sha 256 then set in data.
405
+
406
+ this.state('secure', `sha512:${transport}`); // set state to secure hashing
407
+ data.sha512 = this.lib.hash(data, 'sha512'); // hash data into sha 512 then set in data.
408
+
409
+ this.state('set', `writestr:${transport}`);
410
+ const writestr = data.write.split(' ').join(':').toUpperCase();
411
+
342
412
  const text = [
343
- `WRITE AUTHORIZED OFFICIAL SECURE VectorGuardProxy${data.opts}? if yes then write ${data.message}`,
413
+ '::::',
414
+ `::BEGIN:${writestr}:WALL:${transport}:${data.emojis}`,
415
+ `#VectorGuardWall${data.opts} ${data.message}`,
344
416
  `::begin:VectorGuardWall:${data.transport}`,
345
417
  `transport: ${data.transport}`,
346
- `caseid: ${data.caseid}`,
347
418
  `agent: ${agent.profile.id}`,
348
419
  `client: ${client.profile.id}`,
349
420
  `name: ${data.name}`,
421
+ `fullname: ${data.fullname}`,
422
+ `nickname: ${data.nickname}`,
423
+ `title: ${data.title}`,
350
424
  `token: ${data.token}`,
351
- `timestamp: ${data.timestamp}`,
352
- `computer: ${data.computer}`,
353
- `hardware: ${data.hardware}`,
354
- `provision: ${data.provision}`,
355
- `network: ${data.network}`,
356
- `copyright: ${data.copyright}`,
425
+ `case: ${data.caseid}`,
426
+ `time: ${data.time}`,
357
427
  `created: ${data.created}`,
428
+ `copyright: ${data.copyright}`,
358
429
  `md5: ${data.md5}`,
359
430
  `sha256: ${data.sha256}`,
360
431
  `sha512: ${data.sha512}`,
361
- `::end:VectorGuardShield:${data.transport}`,
432
+ `::end:VectorGuardWall:${data.transport}`,
433
+ `::END:${writestr}:WALL:${transport}:${data.emojis}`,
362
434
  ].join('\n').trim();
363
435
 
364
436
  // send the text data to #feecting to parse and return valid text, html, and data.
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.28",
4
+ "version": "0.0.30",
5
5
  "author": "Quinn Michaels",
6
6
  "license": "MIT",
7
7
  "copyright": "2025",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "homepage": "https://deva.space/devas/guard",
29
29
  "dependencies": {
30
- "@indra.ai/deva": "^1.5.41"
30
+ "@indra.ai/deva": "^1.5.42"
31
31
  },
32
32
  "data": {
33
33
  "agent": {