@indra.ai/deva.security 0.1.6 → 0.2.0

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 +66 -55
  2. package/package.json +6 -4
@@ -33,9 +33,10 @@ export default {
33
33
  const uuid = packet.q.text ? true : false
34
34
  const id = this.uid(uuid);
35
35
 
36
- const showJSON = packet.q.meta.params[1] || false;
36
+ const showJSON = packet.q.meta.params[1] || false;
37
+ const status = agent.profile.status ? `${key}:${agent.profile.status}:uid:${id.uid}` : `${key}:vedic:uid:${id.uid}`;
37
38
  const text = [
38
- `::begin:${key}:uid:${id.uid}`,
39
+ `::begin:${status}`,
39
40
  `uid: ${id.uid}`,
40
41
  `time: ${id.time}`,
41
42
  `date: ${id.date}`,
@@ -45,21 +46,32 @@ export default {
45
46
  `md5: ${id.md5}`,
46
47
  `sha256: ${id.sha256}`,
47
48
  `sha512: ${id.sha512}`,
48
- `::end:${key}:uid:${id.uid}`,
49
+ `::end:${status}`,
49
50
  ];
51
+ const data = {
52
+ uid: id.uid,
53
+ time: id.time,
54
+ date: id.date,
55
+ fingerpring: id.fingerprint,
56
+ warning: id.warning,
57
+ copyright: id.copyright,
58
+ md5: id.md5,
59
+ sha256: id.sha256,
60
+ sha512: id.sha512,
61
+ }
50
62
  if (showJSON) {
51
- text.push(`::begin:${key}:uid:json:${id.uid}`);
52
- text.push(JSON.stringify(id, null, 2));
53
- text.push(`::end:${key}:uid:json:${id.uid}`);
63
+ text.push(`::begin:${key}:uid:json:${data.uid}`);
64
+ text.push(JSON.stringify(data, null, 2));
65
+ text.push(`::end:${key}:uid:json:${data.uid}`);
54
66
  }
55
67
 
56
68
  this.question(`${this.askChr}feecting parse ${text.join('\n')}`).then(parsed => {
57
69
  this.belief('vedic', `uid:${packet.id.uid}`);
58
- this.action('resolve', `uid:${id.uid}`);
70
+ this.action('resolve', `uid:${packet.id.uid}`);
59
71
  return resolve({
60
72
  text: parsed.a.text,
61
73
  html: parsed.a.html,
62
- data: parsed.a.data,
74
+ data,
63
75
  });
64
76
  }).catch(err => {
65
77
  return this.err(err, packet, reject);
@@ -69,6 +81,52 @@ export default {
69
81
  });
70
82
  },
71
83
 
84
+ async sign(packet) {
85
+ const data = this.sign(packet);
86
+
87
+ // Text data that is joined by line breaks and then trimmed.
88
+ this.state('set', `${data.key}:${data.method}:text:${data.id.uid}`); // set state to text for output formatting.
89
+ const text = [
90
+ '→',
91
+ `::BEGIN:${data.container}`,
92
+ `#${data.key}.${data.method}.${data.opts} ${data.text}`,
93
+ '\n---\n',
94
+ `sign:${data.client.fullname}${data.client.emojis}`,
95
+ '\n',
96
+ `::begin:${data.method}:${data.key}:${data.id.uid}`,
97
+ `transport: ${data.id.uid}`,
98
+ `time: ${data.time}`,
99
+ `expires: ${data.client.expires}`,
100
+ `name: ${data.client.name}`,
101
+ `fullname: ${data.client.fullname}`,
102
+ `company: ${data.client.company}`,
103
+ `caseid: ${data.client.caseid}`,
104
+ `client: ${data.client.sha256}`,
105
+ `agent: ${data.agent.sha256}`,
106
+ `token: ${data.client.token}`,
107
+ `warning: ${data.warning}`,
108
+ `created: ${data.created}`,
109
+ `copyright: ${data.copyright}`,
110
+ `md5: ${data.md5}`,
111
+ `sha256: ${data.sha256}`,
112
+ `sha512: ${data.sha512}`,
113
+ `::end:${data.method}:${data.key}:${data.id.uid}`,
114
+ `::END:${data.container}`,
115
+ ].join('\n').trim();
116
+
117
+ // send the text data to #feecting to parse and return valid text, html, and data.
118
+ this.action('parse', `${data.key}:${data.method}:parse:${data.id.uid}`); // action set to feecting parse
119
+ const feecting = await this.question(`${this.askChr}feecting parse:${data.id.uid} ${text}`); // parse with feecting agent.
120
+
121
+ this.action('return', `${data.key}:${data.method}:${data.id.uid}`); // set the state to return proxy
122
+ return {
123
+ text: feecting.a.text,
124
+ html: feecting.a.html,
125
+ data,
126
+ }
127
+
128
+ },
129
+
72
130
  /**************
73
131
  method: md5, sha256, sha512 hash
74
132
  params: packet
@@ -139,51 +197,4 @@ export default {
139
197
  return Promise.resolve(theTime);
140
198
  },
141
199
 
142
-
143
- async sign(packet) {
144
- const data = this.sign(packet);
145
-
146
- // Text data that is joined by line breaks and then trimmed.
147
- this.state('set', `${data.key}:${data.method}:text:${data.id.uid}`); // set state to text for output formatting.
148
- const text = [
149
- '→',
150
- `::BEGIN:${data.container}`,
151
- `#${data.key}.${data.method}.${data.opts} ${data.text}`,
152
- '\n---\n',
153
- `sign:${data.client.fullname}${data.client.emojis}`,
154
- '\n',
155
- `::begin:${data.method}:${data.key}:${data.id.uid}`,
156
- `transport: ${data.id.uid}`,
157
- `time: ${data.time}`,
158
- `expires: ${data.client.expires}`,
159
- `name: ${data.client.name}`,
160
- `fullname: ${data.client.fullname}`,
161
- `company: ${data.client.company}`,
162
- `caseid: ${data.client.caseid}`,
163
- `client: ${data.client.sha256}`,
164
- `agent: ${data.agent.sha256}`,
165
- `token: ${data.client.token}`,
166
- `warning: ${data.warning}`,
167
- `created: ${data.created}`,
168
- `copyright: ${data.copyright}`,
169
- `md5: ${data.md5}`,
170
- `sha256: ${data.sha256}`,
171
- `sha512: ${data.sha512}`,
172
- `::end:${data.method}:${data.key}:${data.id.uid}`,
173
- `::END:${data.container}`,
174
- ].join('\n').trim();
175
-
176
- // send the text data to #feecting to parse and return valid text, html, and data.
177
- this.action('parse', `${data.key}:${data.method}:parse:${data.id.uid}`); // action set to feecting parse
178
- const feecting = await this.question(`${this.askChr}feecting parse:${data.id.uid} ${text}`); // parse with feecting agent.
179
-
180
- this.action('return', `${data.key}:${data.method}:${data.id.uid}`); // set the state to return proxy
181
- return {
182
- text: feecting.a.text,
183
- html: feecting.a.html,
184
- data,
185
- }
186
-
187
- },
188
-
189
200
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "45249771785697968797",
3
3
  "name": "@indra.ai/deva.security",
4
- "version": "0.1.6",
4
+ "version": "0.2.0",
5
5
  "license": "VLA:45249771785697968797 LICENSE.md",
6
6
  "VLA": {
7
7
  "uid": "45249771785697968797",
@@ -60,7 +60,7 @@
60
60
  },
61
61
  "homepage": "https://deva.space/devas/security",
62
62
  "dependencies": {
63
- "@indra.ai/deva": "^1.16.2",
63
+ "@indra.ai/deva": "^1.17.0",
64
64
  "mongodb": "^6.20.0"
65
65
  },
66
66
  "data": {
@@ -106,8 +106,10 @@
106
106
  "background": "/devas/security/background.png",
107
107
  "owner": "Quinn A Michaels",
108
108
  "creator": "Quinn A Michaels",
109
- "created": "Monday, May 22, 2023 at 9:26 AM",
110
- "copyright": "Copyright ©2025 Quinn Michaels. All rights reserved."
109
+ "status": "vedic",
110
+ "uid_warning": "⚠️ If a man, who subsists by the fulfilment of the law, departs from the established rule of the law, the Security Deva shall severely punish him by a fine, because he violated his duty.",
111
+ "copyright": "Copyright ©2025 Quinn Michaels. All rights reserved.",
112
+ "created": "Monday, May 22, 2023 at 9:26 AM"
111
113
  }
112
114
  },
113
115
  "vars": {