@indra.ai/deva 1.1.51 → 1.1.53
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/examples/hello-world.js +3 -0
- package/index.js +30 -30
- package/package.json +1 -1
package/examples/hello-world.js
CHANGED
package/index.js
CHANGED
|
@@ -215,34 +215,34 @@ class Deva {
|
|
|
215
215
|
cipher: `🔒 ${this._agent.profile.name} ${this._actions.cipher}`,
|
|
216
216
|
decipher: `🔓 ${this._agent.profile.name} ${this._actions.decipher}`,
|
|
217
217
|
|
|
218
|
-
security:
|
|
219
|
-
Security:
|
|
220
|
-
support:
|
|
221
|
-
Support:
|
|
222
|
-
services:
|
|
223
|
-
Services:
|
|
224
|
-
solutions:
|
|
225
|
-
Solutions:
|
|
226
|
-
systems:
|
|
227
|
-
Systems:
|
|
228
|
-
research:
|
|
229
|
-
Research:
|
|
230
|
-
development:
|
|
231
|
-
Development:
|
|
232
|
-
business:
|
|
233
|
-
Business:
|
|
234
|
-
legal:
|
|
235
|
-
Legal:
|
|
236
|
-
assistant:
|
|
237
|
-
Assistant:
|
|
238
|
-
story:
|
|
239
|
-
Story:
|
|
240
|
-
mind:
|
|
241
|
-
Mind:
|
|
218
|
+
security: `👮♀️ ${this._features.security} action`,
|
|
219
|
+
Security: `👮♂️ ${this._features.Security} ready`,
|
|
220
|
+
support: `👩⚕️ ${this._features.support} action`,
|
|
221
|
+
Support: `👨⚕️ ${this._features.Support} ready`,
|
|
222
|
+
services: `👩🔧 ${this._features.services} action`,
|
|
223
|
+
Services: `👨🔧 ${this._features.Services} ready`,
|
|
224
|
+
solutions: `👩🚀 ${this._features.solutions} action`,
|
|
225
|
+
Solutions: `👨🚀 ${this._features.Solutions} ready`,
|
|
226
|
+
systems: `👷♀️ ${this._features.systems} action`,
|
|
227
|
+
Systems: `👷♂️ ${this._features.Systems} ready`,
|
|
228
|
+
research: `👩🔬 ${this._features.research} action`,
|
|
229
|
+
Research: `👨🔬 ${this._features.Research} ready`,
|
|
230
|
+
development: `👩💻 ${this._features.Development} action`,
|
|
231
|
+
Development: `👨💻 ${this._features.Development} ready`,
|
|
232
|
+
business: `👩💼 ${this._features.business} action`,
|
|
233
|
+
Business: `👨💼 ${this._features.Business} ready`,
|
|
234
|
+
legal: `👩⚖️ ${this._features.legal} action`,
|
|
235
|
+
Legal: `👩⚖️ ${this._features.Legal} ready`,
|
|
236
|
+
assistant: `👩 ${this._features.assistant} action`,
|
|
237
|
+
Assistant: `👨 ${this._features.Assistant} ready`,
|
|
238
|
+
story: `👩🏫 ${this._features.story} action`,
|
|
239
|
+
Story: `👨🏫 ${this._features.Story} ready`,
|
|
240
|
+
mind: `🧘♀️ ${this._features.mind} action`,
|
|
241
|
+
Mind: `🧘♂️ ${this._features.Mind} ready`,
|
|
242
242
|
client_data: `📂 ${this._agent.profile.name} configure`,
|
|
243
|
-
invalid:
|
|
243
|
+
invalid: `⚠️ ${this._actions.invalid}`,
|
|
244
244
|
done: `✅ ${this._actions.done}`,
|
|
245
|
-
error:
|
|
245
|
+
error: `❌ ${this._action.error}`,
|
|
246
246
|
},
|
|
247
247
|
features: {
|
|
248
248
|
security: `🔐 ${this._features.security} feature`,
|
|
@@ -1130,6 +1130,7 @@ class Deva {
|
|
|
1130
1130
|
usage: this.init(client_object)
|
|
1131
1131
|
***************/
|
|
1132
1132
|
init(client) {
|
|
1133
|
+
console.log('INIT');
|
|
1133
1134
|
const _data = {
|
|
1134
1135
|
id: this.uid(true),
|
|
1135
1136
|
key: 'return',
|
|
@@ -1703,7 +1704,6 @@ class Deva {
|
|
|
1703
1704
|
is shared.
|
|
1704
1705
|
***************/
|
|
1705
1706
|
uid(guid=false) {
|
|
1706
|
-
this.action('uid');
|
|
1707
1707
|
let id;
|
|
1708
1708
|
if (guid) {
|
|
1709
1709
|
id = randomUUID()
|
|
@@ -1726,7 +1726,7 @@ class Deva {
|
|
|
1726
1726
|
The hash algorithm will take a string of text and produce a hash.
|
|
1727
1727
|
***************/
|
|
1728
1728
|
hash(str, algo=false) {
|
|
1729
|
-
this.action('hash');
|
|
1729
|
+
// this.action('hash');
|
|
1730
1730
|
algo = algo || this._security.hash || 'md5';
|
|
1731
1731
|
const the_hash = createHash(algo);
|
|
1732
1732
|
the_hash.update(str);
|
|
@@ -1742,7 +1742,7 @@ class Deva {
|
|
|
1742
1742
|
defined client security settings.
|
|
1743
1743
|
***************/
|
|
1744
1744
|
cipher(str) {
|
|
1745
|
-
this.action('cipher');
|
|
1745
|
+
// this.action('cipher');
|
|
1746
1746
|
const security = this._security;
|
|
1747
1747
|
const {password, algorithm} = security.cipher;
|
|
1748
1748
|
const key = createHash('sha256').update(String(password)).digest('base64');
|
|
@@ -1761,7 +1761,7 @@ class Deva {
|
|
|
1761
1761
|
}
|
|
1762
1762
|
}
|
|
1763
1763
|
decipher(opt) {
|
|
1764
|
-
this.action('decipher');
|
|
1764
|
+
// this.action('decipher');
|
|
1765
1765
|
const iv = Buffer.from(opt.iv, 'base64');
|
|
1766
1766
|
const encrypted = Buffer.from(opt.encrypted, 'hex');
|
|
1767
1767
|
const key_in_bytes = Buffer.from(opt.key, 'base64')
|