@indra.ai/deva.vector 0.0.12 → 0.0.13

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 +40 -16
  2. package/package.json +2 -2
@@ -50,16 +50,25 @@ export default {
50
50
  const write = `OM:${key.toUpperCase()}:${client.profile.write.split(' ').join(':').toUpperCase()}`; // set proxy write string.
51
51
 
52
52
  // hash the agent profile for security
53
- this.state('hash', `${key}:sign:${type}:write:${transport}`);
53
+ this.state('hash', `${key}:sign:${type}:packet:sha256:${transport}`);
54
+ const packet_hash = this.lib.hash(packet, 'sha256');
55
+
56
+ // hash the agent profile for security
57
+ this.state('hash', `${key}:sign:${type}:agent:sha256:${transport}`);
54
58
  const agent_hash = this.lib.hash(agent, 'sha256');
55
59
 
56
60
  // hash the agent profile for security
57
- this.state('hash', `${key}:sign:${type}:write:${transport}`);
61
+ this.state('hash', `${key}:sign:${type}:client:sha256:${transport}`);
58
62
  const client_hash = this.lib.hash(client, 'sha256');
63
+
64
+ // hash the agent profile for security
65
+ this.state('hash', `${key}:sign:${type}:laws:sha256:${transport}`);
66
+ const laws_hash = this.lib.hash(client.profile.laws, 'sha256');
59
67
 
60
68
  // hash the agent profile for security
61
- this.state('hash', `${key}:sign:${type}:write:${transport}`);
69
+ this.state('hash', `${key}:sign:${type}:token:${transport}`);
62
70
  const token = this.lib.hash(`${key} ${client.profile.token} ${transport}`, 'sha256');
71
+
63
72
 
64
73
  this.state('set', `${key}:sign:${type}:write:${transport}`); // set the state to set data
65
74
  // data packet
@@ -71,13 +80,15 @@ export default {
71
80
  message,
72
81
  caseid: client.profile.caseid,
73
82
  opts: opts.length? `:${opts.join(':')}` : '',
74
- agent: agent_hash,
75
- client: client_hash,
76
83
  name: client.profile.name,
77
- name: client.profile.fullname,
84
+ fullname: client.profile.fullname,
85
+ birthname: client.profile.birthname,
78
86
  emojis: client.profile.emojis,
79
87
  company: client.profile.company,
80
- law: client.profile.law,
88
+ client: client_hash,
89
+ agent: agent_hash,
90
+ packet: packet_hash,
91
+ laws: laws_hash,
81
92
  warning: client.profile.warning,
82
93
  token,
83
94
  concerns,
@@ -102,25 +113,32 @@ export default {
102
113
  const text = [
103
114
  `::::`,
104
115
  `::BEGIN:${data.write}:${data.transport}`,
105
- `#${key}:${type}${data.opts} ${data.message}`,
106
- `::begin:${key}:${transport}:${data.emojis}`,
116
+ `write #${key}:${type}${data.opts} ${data.message}`,
117
+ '\n---\n',
118
+ 'Signed',
119
+ data.fullname,
120
+ data.emojis,
121
+ '\n',
122
+ `::begin:${key}:${type}:${transport}`,
107
123
  `transport: ${data.transport}`,
108
124
  `time: ${data.time}`,
125
+ `name: ${data.name}`,
126
+ `fullname: ${data.fullname}`,
127
+ `birthname: ${data.birthname}`,
128
+ `company: ${data.company}`,
109
129
  `caseid: ${data.caseid}`,
110
130
  `agent: ${data.agent}`,
111
131
  `client: ${data.client}`,
132
+ `packet: ${data.packet}`,
112
133
  `token: ${data.token}`,
113
- `name: ${data.name}`,
114
- `fullname: ${data.fullanme}`,
115
- `company: ${data.company}`,
116
- `law: ${data.law}`,
134
+ `laws: ${data.laws}`,
117
135
  `warning: ${data.warning}`,
118
136
  `created: ${data.created}`,
119
137
  `copyright: ${data.copyright}`,
120
138
  `md5: ${data.md5}`,
121
139
  `sha256: ${data.sha256}`,
122
140
  `sha512: ${data.sha512}`,
123
- `::end:${key}:${type}${data.transport}:${data.emojis}`,
141
+ `::end:${key}:${type}${data.transport}`,
124
142
  `::END:${data.write}:${data.transport}`,
125
143
  `::::`
126
144
  ].join('\n').trim();
@@ -138,8 +156,9 @@ export default {
138
156
 
139
157
  },
140
158
 
141
- async echo(key, type, opts) {
142
- const {id, agent, client, text, created, md5, sha256, sha512} = opts;
159
+ async echo(key, type, packet) {
160
+
161
+ const {id, agent, client, text, created, md5, sha256, sha512} = packet[type];
143
162
 
144
163
  this.state('set', `${key}:echo:${type}:time:${id}`);
145
164
  const echo_time = Date.now();
@@ -149,6 +168,10 @@ export default {
149
168
  this.state('hash', `${key}:echo:${type}:hash:message:${id}`);
150
169
  const message_hash = this.lib.hash(text || 'blank', 'sha256');
151
170
 
171
+ // hash the agent profile for security
172
+ this.state('hash', `${key}:echo:${type}:packet:sha256:${id}`);
173
+ const packet_hash = this.lib.hash(packet, 'sha256');
174
+
152
175
  this.state('hash', `${key}:echo:${type}:hash:agent:${id}`);
153
176
  const agent_hash = this.lib.hash(agent, 'sha256');
154
177
 
@@ -170,6 +193,7 @@ export default {
170
193
  `message: ${message_hash}`,
171
194
  `agent: ${agent_hash}`,
172
195
  `client: ${client_hash}`,
196
+ `packet: ${packet_hash}`,
173
197
  `md5: ${md5}`,
174
198
  `sha256:${sha256}`,
175
199
  `sha512:${sha512}`,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "33555f8a-707d-4fc9-ae19-ba09036473d4",
3
3
  "name": "@indra.ai/deva.vector",
4
- "version": "0.0.12",
4
+ "version": "0.0.13",
5
5
  "author": "Quinn Michaels",
6
6
  "license": "MIT",
7
7
  "copyright": "2025",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "homepage": "https://deva.space/devas/vector",
30
30
  "dependencies": {
31
- "@indra.ai/deva": "^1.5.49"
31
+ "@indra.ai/deva": "^1.5.50"
32
32
  },
33
33
  "data": {
34
34
  "agent": {