@indra.ai/deva.vector 0.0.11 → 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.
- package/feature/methods.js +40 -14
- package/index.js +2 -2
- package/package.json +2 -2
package/feature/methods.js
CHANGED
|
@@ -8,8 +8,6 @@ export default {
|
|
|
8
8
|
this.state('set', `${key}:sign:${type}:${packet.id}`);
|
|
9
9
|
const transport = packet.id; // set the transport id from the packet id.
|
|
10
10
|
|
|
11
|
-
this.prompt(`sign ${key}`);
|
|
12
|
-
|
|
13
11
|
this.zone(key, `${key}:sign:${type}:${transport}`); // set the zone
|
|
14
12
|
this.feature(key, `${key}:sign:${type}:${transport}`); // set the feature
|
|
15
13
|
this.context(key, `${key}:sign:${type}:${transport}`); // set the agent context to proxy.
|
|
@@ -52,16 +50,25 @@ export default {
|
|
|
52
50
|
const write = `OM:${key.toUpperCase()}:${client.profile.write.split(' ').join(':').toUpperCase()}`; // set proxy write string.
|
|
53
51
|
|
|
54
52
|
// hash the agent profile for security
|
|
55
|
-
this.state('hash', `${key}:sign:${type}:
|
|
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}`);
|
|
56
58
|
const agent_hash = this.lib.hash(agent, 'sha256');
|
|
57
59
|
|
|
58
60
|
// hash the agent profile for security
|
|
59
|
-
this.state('hash', `${key}:sign:${type}:
|
|
61
|
+
this.state('hash', `${key}:sign:${type}:client:sha256:${transport}`);
|
|
60
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');
|
|
61
67
|
|
|
62
68
|
// hash the agent profile for security
|
|
63
|
-
this.state('hash', `${key}:sign:${type}:
|
|
69
|
+
this.state('hash', `${key}:sign:${type}:token:${transport}`);
|
|
64
70
|
const token = this.lib.hash(`${key} ${client.profile.token} ${transport}`, 'sha256');
|
|
71
|
+
|
|
65
72
|
|
|
66
73
|
this.state('set', `${key}:sign:${type}:write:${transport}`); // set the state to set data
|
|
67
74
|
// data packet
|
|
@@ -73,11 +80,15 @@ export default {
|
|
|
73
80
|
message,
|
|
74
81
|
caseid: client.profile.caseid,
|
|
75
82
|
opts: opts.length? `:${opts.join(':')}` : '',
|
|
76
|
-
agent: agent_hash,
|
|
77
|
-
client: client_hash,
|
|
78
83
|
name: client.profile.name,
|
|
84
|
+
fullname: client.profile.fullname,
|
|
85
|
+
birthname: client.profile.birthname,
|
|
79
86
|
emojis: client.profile.emojis,
|
|
80
87
|
company: client.profile.company,
|
|
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,23 +113,32 @@ export default {
|
|
|
102
113
|
const text = [
|
|
103
114
|
`::::`,
|
|
104
115
|
`::BEGIN:${data.write}:${data.transport}`,
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
`
|
|
114
|
-
`company: ${data.company}`,
|
|
134
|
+
`laws: ${data.laws}`,
|
|
115
135
|
`warning: ${data.warning}`,
|
|
116
136
|
`created: ${data.created}`,
|
|
117
137
|
`copyright: ${data.copyright}`,
|
|
118
138
|
`md5: ${data.md5}`,
|
|
119
139
|
`sha256: ${data.sha256}`,
|
|
120
140
|
`sha512: ${data.sha512}`,
|
|
121
|
-
`::end:${key}:${type}${data.transport}
|
|
141
|
+
`::end:${key}:${type}${data.transport}`,
|
|
122
142
|
`::END:${data.write}:${data.transport}`,
|
|
123
143
|
`::::`
|
|
124
144
|
].join('\n').trim();
|
|
@@ -136,8 +156,9 @@ export default {
|
|
|
136
156
|
|
|
137
157
|
},
|
|
138
158
|
|
|
139
|
-
async echo(key, type,
|
|
140
|
-
|
|
159
|
+
async echo(key, type, packet) {
|
|
160
|
+
|
|
161
|
+
const {id, agent, client, text, created, md5, sha256, sha512} = packet[type];
|
|
141
162
|
|
|
142
163
|
this.state('set', `${key}:echo:${type}:time:${id}`);
|
|
143
164
|
const echo_time = Date.now();
|
|
@@ -147,6 +168,10 @@ export default {
|
|
|
147
168
|
this.state('hash', `${key}:echo:${type}:hash:message:${id}`);
|
|
148
169
|
const message_hash = this.lib.hash(text || 'blank', 'sha256');
|
|
149
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
|
+
|
|
150
175
|
this.state('hash', `${key}:echo:${type}:hash:agent:${id}`);
|
|
151
176
|
const agent_hash = this.lib.hash(agent, 'sha256');
|
|
152
177
|
|
|
@@ -168,6 +193,7 @@ export default {
|
|
|
168
193
|
`message: ${message_hash}`,
|
|
169
194
|
`agent: ${agent_hash}`,
|
|
170
195
|
`client: ${client_hash}`,
|
|
196
|
+
`packet: ${packet_hash}`,
|
|
171
197
|
`md5: ${md5}`,
|
|
172
198
|
`sha256:${sha256}`,
|
|
173
199
|
`sha512:${sha512}`,
|
package/index.js
CHANGED
|
@@ -35,10 +35,10 @@ const VECTOR = new Deva({
|
|
|
35
35
|
},
|
|
36
36
|
listeners: {
|
|
37
37
|
'devacore:question'(packet) {
|
|
38
|
-
const echo = this.methods.echo('vector', '
|
|
38
|
+
const echo = this.methods.echo('vector', 'q', packet);
|
|
39
39
|
},
|
|
40
40
|
'devacore:answer'(packet) {
|
|
41
|
-
const echo = this.methods.echo('vector', '
|
|
41
|
+
const echo = this.methods.echo('vector', 'a', packet);
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
modules: {},
|
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.
|
|
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.
|
|
31
|
+
"@indra.ai/deva": "^1.5.50"
|
|
32
32
|
},
|
|
33
33
|
"data": {
|
|
34
34
|
"agent": {
|