@indra.ai/deva 1.1.105 → 1.1.107
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/config.json +25 -40
- package/index.js +31 -98
- package/package.json +1 -1
package/config.json
CHANGED
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"exit": "exiting deva.world",
|
|
41
41
|
"load": "loading",
|
|
42
42
|
"unload": "unloading",
|
|
43
|
-
"invalid": "invalid state",
|
|
44
43
|
"done": "done state",
|
|
45
44
|
"finish": "finish state",
|
|
45
|
+
"invalid": "invalid state",
|
|
46
46
|
"error": "error state",
|
|
47
47
|
"help": "help state"
|
|
48
48
|
},
|
|
@@ -95,68 +95,53 @@
|
|
|
95
95
|
"trimmer": "::agent.name:: is trimming a word count",
|
|
96
96
|
"dupes": "::agent.name:: is removing duplicates",
|
|
97
97
|
"security": "SECURITY",
|
|
98
|
-
"Security": "Security Feature",
|
|
99
98
|
"support": "SUPPORT",
|
|
100
|
-
"Support": "Support Feature",
|
|
101
99
|
"systems": "SYSTMS",
|
|
102
|
-
"Systems": "Systems Feature",
|
|
103
100
|
"services": "SERVICES",
|
|
104
|
-
"Services": "Services Feature",
|
|
105
101
|
"solutions": "SOLUTIONS",
|
|
106
|
-
"Solutions": "Solutions Feature",
|
|
107
102
|
"research": "RESEARCH",
|
|
108
|
-
"Research": "Research Feature",
|
|
109
103
|
"development": "DEVELOPMENT",
|
|
110
|
-
"Development": "Development Feature",
|
|
111
104
|
"business": "BUSINESS",
|
|
112
|
-
"Business": "Business Feature",
|
|
113
105
|
"legal": "LEGAL",
|
|
114
|
-
"Legal": "Legal Feature",
|
|
115
106
|
"assistant": "ASSISTANT",
|
|
116
|
-
"
|
|
117
|
-
"story": "STORY",
|
|
118
|
-
"Story": "Story Feature",
|
|
107
|
+
"artist": "ARTIST",
|
|
119
108
|
"mind": "MIND",
|
|
120
|
-
"
|
|
121
|
-
"
|
|
109
|
+
"Client": "::agent.name:: configure #client",
|
|
110
|
+
"Security": "::agent.name:: configure #security",
|
|
111
|
+
"Support": "::agent.name:: configure #support",
|
|
112
|
+
"Systems": "::agent.name:: configure #systems",
|
|
113
|
+
"Services": "::agent.name:: ocnfigure #services",
|
|
114
|
+
"Solutions": "::agent.name:: configure #solutions",
|
|
115
|
+
"Research": "::agent.name:: configure #research",
|
|
116
|
+
"Development": "::agent.name:: configure #development",
|
|
117
|
+
"Legal": "::agent.name:: configure #legal",
|
|
118
|
+
"Business": "::agent.name:: configure #business",
|
|
119
|
+
"Assistant": "::agent.name:: configure #assistant",
|
|
120
|
+
"Artist": "::agent.name:: configure #artist",
|
|
121
|
+
"Mind": "::agent.name:: configure #mind",
|
|
122
|
+
"Done": "::agent.name:: configure #done",
|
|
122
123
|
"invalid": "::agent.name:: invalid",
|
|
123
|
-
"finish": "::agent.name:: finished",
|
|
124
|
-
"error": "::agent.name:: error",
|
|
125
|
-
"done": "::agent.name:: eone",
|
|
126
124
|
"states": "::agent.name:: getting states",
|
|
127
125
|
"actions": "::agent.name:: getting actions",
|
|
128
126
|
"zones": "::agent.name:: getting zones",
|
|
129
127
|
"features": "::agent.name:: Getting features",
|
|
130
|
-
"contexs": "::agent.name:: Getting contexts"
|
|
128
|
+
"contexs": "::agent.name:: Getting contexts",
|
|
129
|
+
"finish": "::agent.name:: finished"
|
|
131
130
|
},
|
|
132
131
|
"feature": false,
|
|
133
132
|
"features": {
|
|
134
133
|
"security": "Security",
|
|
135
|
-
"Security": "SECURITY Feature",
|
|
136
134
|
"support": "Support",
|
|
137
|
-
"Support": "SUPPORT Feature",
|
|
138
135
|
"services": "Services",
|
|
139
|
-
"Services": "SERVICES",
|
|
140
136
|
"solutions": "Solutions",
|
|
141
|
-
"Solutions": "SOLUTIONS Feature",
|
|
142
137
|
"systems": "Systems",
|
|
143
|
-
"Systems": "SYSTEMS Feature",
|
|
144
138
|
"research": "Research",
|
|
145
|
-
"Research": "RESEARCH Feature",
|
|
146
139
|
"development": "Development",
|
|
147
|
-
"Development": "DEVELOPMENT Feature",
|
|
148
140
|
"business": "Business",
|
|
149
|
-
"Business": "BUSINESS Feature",
|
|
150
141
|
"legal": "Legal",
|
|
151
|
-
"Legal": "LEGAL Feature",
|
|
152
142
|
"assistant": "Assistant",
|
|
153
|
-
"
|
|
154
|
-
"
|
|
155
|
-
"Story": "STORY Feature",
|
|
156
|
-
"mind": "Story",
|
|
157
|
-
"Mind": "MIND Feature",
|
|
158
|
-
"error": "Feature Error",
|
|
159
|
-
"done": "Features Done"
|
|
143
|
+
"artist": "Artist",
|
|
144
|
+
"mind": "Mind"
|
|
160
145
|
},
|
|
161
146
|
"message": "offline",
|
|
162
147
|
"messages": {
|
|
@@ -234,8 +219,8 @@
|
|
|
234
219
|
"Legal": "::agent.name:: is loading the Legal Feature",
|
|
235
220
|
"assistant": "::agent.name:: is accessing the #assistant feature",
|
|
236
221
|
"Assistant": "::agent.name:: is loading the Assistant Feature",
|
|
237
|
-
"
|
|
238
|
-
"
|
|
222
|
+
"artist": "::agent.name:: is accessing the #artist feature",
|
|
223
|
+
"Artist": "::agent.name:: is loading the Artist Feature",
|
|
239
224
|
"mind": "::agent.name:: is accessing the #mind feature",
|
|
240
225
|
"Mind": "::agent.name:: is loading the Mind Feature",
|
|
241
226
|
"client_data": "::agent.name:: configure",
|
|
@@ -271,9 +256,9 @@
|
|
|
271
256
|
"Legal": "Legal configure",
|
|
272
257
|
"assistant": "assistant feature",
|
|
273
258
|
"Assistant": "Assistant configure",
|
|
274
|
-
"
|
|
275
|
-
"
|
|
276
|
-
"mind": "
|
|
259
|
+
"artist": "artist feature",
|
|
260
|
+
"Artist": "Artist configure",
|
|
261
|
+
"mind": "mind feature",
|
|
277
262
|
"Mind": "Mind configure",
|
|
278
263
|
"invalid": "feature invalid",
|
|
279
264
|
"done": "feature done",
|
package/index.js
CHANGED
|
@@ -26,7 +26,7 @@ class Deva {
|
|
|
26
26
|
this._business = false; // inherited Business features.
|
|
27
27
|
this._legal = false; // inherited Legal features.
|
|
28
28
|
this._assistant = false; // inherited Assistant features.
|
|
29
|
-
this.
|
|
29
|
+
this._artist = false; // inherited artist features.
|
|
30
30
|
this.events = opts.events || new EventEmitter({}); // Event Bus
|
|
31
31
|
this.lib = opts.lib || {}; // used for loading library functions
|
|
32
32
|
this.devas = opts.devas || {}; // Devas which are loaded
|
|
@@ -189,6 +189,7 @@ class Deva {
|
|
|
189
189
|
This will return a not found text string preventing any furhter processing.
|
|
190
190
|
***************/
|
|
191
191
|
_methodNotFound(packet) {
|
|
192
|
+
this.action('invalid');
|
|
192
193
|
packet.a = {
|
|
193
194
|
id: this.uid(),
|
|
194
195
|
agent: this.agent() || false,
|
|
@@ -200,7 +201,6 @@ class Deva {
|
|
|
200
201
|
},
|
|
201
202
|
created: Date.now(),
|
|
202
203
|
};
|
|
203
|
-
this.state('method_not_found');
|
|
204
204
|
return packet;
|
|
205
205
|
}
|
|
206
206
|
|
|
@@ -215,7 +215,7 @@ class Deva {
|
|
|
215
215
|
this.Client = {data}
|
|
216
216
|
***************/
|
|
217
217
|
Client(client) {
|
|
218
|
-
this.action('
|
|
218
|
+
this.action('Client');
|
|
219
219
|
const _client = this.copy(client); // copy the client parameter
|
|
220
220
|
this._client = _client; // set local _client to this scope
|
|
221
221
|
return Promise.resolve();
|
|
@@ -229,7 +229,6 @@ class Deva {
|
|
|
229
229
|
client presented data.
|
|
230
230
|
***************/
|
|
231
231
|
Security() {
|
|
232
|
-
this.feature('Security'); // set feature to Security
|
|
233
232
|
const _cl = this.client(); // set local copy of client data
|
|
234
233
|
try {
|
|
235
234
|
if (!_cl.features.security) return this.Support(); // if no security feature goto Support
|
|
@@ -251,8 +250,6 @@ class Deva {
|
|
|
251
250
|
return this.Support(); // goto Support when done with Security
|
|
252
251
|
}
|
|
253
252
|
} catch (e) {
|
|
254
|
-
this.action('error'); // set the action to error
|
|
255
|
-
this.feature('error'); // set the feature to error
|
|
256
253
|
return this.error(e); // run error handling if an error is caught
|
|
257
254
|
}
|
|
258
255
|
}
|
|
@@ -265,7 +262,6 @@ class Deva {
|
|
|
265
262
|
client presented data.
|
|
266
263
|
***************/
|
|
267
264
|
Support() {
|
|
268
|
-
this.feature('Support'); // set state to support setting
|
|
269
265
|
const _cl = this.client(); // set the local client variable
|
|
270
266
|
try {
|
|
271
267
|
if (!_cl.features.support) return this.Services() // move to Services if no support feature
|
|
@@ -285,8 +281,6 @@ class Deva {
|
|
|
285
281
|
return this.Services(); // when done move to Services
|
|
286
282
|
}
|
|
287
283
|
} catch (e) {
|
|
288
|
-
this.action('error'); // set the action to error
|
|
289
|
-
this.feature('error'); // set the feature to error
|
|
290
284
|
return this.error(e); // run error handling if an error is caught
|
|
291
285
|
}
|
|
292
286
|
}
|
|
@@ -299,7 +293,6 @@ class Deva {
|
|
|
299
293
|
client presented data.
|
|
300
294
|
***************/
|
|
301
295
|
Services() {
|
|
302
|
-
this.feature('Services'); // set state to security setting
|
|
303
296
|
const _cl = this.client(); // set local client
|
|
304
297
|
try {
|
|
305
298
|
if (!_cl.features.services) return this.Systems(); // move to Systems if no Services feature
|
|
@@ -319,8 +312,6 @@ class Deva {
|
|
|
319
312
|
return this.Systems() // go to Systems when done
|
|
320
313
|
}
|
|
321
314
|
} catch (e) {
|
|
322
|
-
this.action('error'); // set the action to error
|
|
323
|
-
this.feature('error'); // set the feature to error
|
|
324
315
|
return this.error(e); // run error handling if an error is caught
|
|
325
316
|
}
|
|
326
317
|
}
|
|
@@ -333,7 +324,6 @@ class Deva {
|
|
|
333
324
|
client presented data.
|
|
334
325
|
***************/
|
|
335
326
|
Systems() {
|
|
336
|
-
this.feature('Systems'); // set state to systems setting
|
|
337
327
|
const _cl = this.client();
|
|
338
328
|
try {
|
|
339
329
|
if (!_cl.features.systems) return this.Solutions(); // move to Solutions if no systems feature
|
|
@@ -353,8 +343,6 @@ class Deva {
|
|
|
353
343
|
return this.Solutions()
|
|
354
344
|
}
|
|
355
345
|
} catch (e) {
|
|
356
|
-
this.action('error'); // set the action to error
|
|
357
|
-
this.feature('error'); // set the feature to error
|
|
358
346
|
return this.error(e); // run error handling if an error is caught
|
|
359
347
|
}
|
|
360
348
|
}
|
|
@@ -367,7 +355,6 @@ class Deva {
|
|
|
367
355
|
client presented data.
|
|
368
356
|
***************/
|
|
369
357
|
Solutions() {
|
|
370
|
-
this.feature('Solutions'); // set state to solutions setting
|
|
371
358
|
const _cl = this.client();
|
|
372
359
|
try {
|
|
373
360
|
if (!_cl.features.solutions) return this.Research(); // moe to research if no solutions
|
|
@@ -387,8 +374,6 @@ class Deva {
|
|
|
387
374
|
return this.Research()
|
|
388
375
|
}
|
|
389
376
|
} catch (e) {
|
|
390
|
-
this.action('error'); // set the action to error
|
|
391
|
-
this.feature('error'); // set the feature to error
|
|
392
377
|
return this.error(e); // run error handling if an error is caught
|
|
393
378
|
}
|
|
394
379
|
}
|
|
@@ -401,7 +386,6 @@ class Deva {
|
|
|
401
386
|
client presented data.
|
|
402
387
|
***************/
|
|
403
388
|
Research() {
|
|
404
|
-
this.feature('Research'); // set state to development setting
|
|
405
389
|
const _cl = this.client(); // set local client variable
|
|
406
390
|
try {
|
|
407
391
|
if (!_cl.features.research) return this.Development(); // if no research goto Business
|
|
@@ -421,8 +405,6 @@ class Deva {
|
|
|
421
405
|
return this.Development(); // goto Development.
|
|
422
406
|
}
|
|
423
407
|
} catch (e) {
|
|
424
|
-
this.action('error'); // set the action to error
|
|
425
|
-
this.feature('error'); // set the feature to error
|
|
426
408
|
return this.error(e); // run error handling if an error is caught
|
|
427
409
|
}
|
|
428
410
|
}
|
|
@@ -435,7 +417,6 @@ class Deva {
|
|
|
435
417
|
client presented data.
|
|
436
418
|
***************/
|
|
437
419
|
Development() {
|
|
438
|
-
this.feature('Development'); // set state to development setting
|
|
439
420
|
const _cl = this.client(); // get hte client data to local variable
|
|
440
421
|
try {
|
|
441
422
|
if (!_cl.features.development) return this.Business(); // if no development goto Business
|
|
@@ -455,8 +436,6 @@ class Deva {
|
|
|
455
436
|
return this.Business(); // goto business when development is done
|
|
456
437
|
}
|
|
457
438
|
} catch (e) {
|
|
458
|
-
this.action('error'); // set the action to error
|
|
459
|
-
this.feature('error'); // set the feature to error
|
|
460
439
|
return this.error(e); // run error handling if an error is caught
|
|
461
440
|
}
|
|
462
441
|
}
|
|
@@ -469,7 +448,6 @@ class Deva {
|
|
|
469
448
|
client presented data.
|
|
470
449
|
***************/
|
|
471
450
|
Business() {
|
|
472
|
-
this.feature('Business'); // set state to business setting
|
|
473
451
|
const _cl = this.client(); // set client into local variable.
|
|
474
452
|
try {
|
|
475
453
|
if (!_cl.features.business) return this.Legal(); // if no business hten goto legal
|
|
@@ -489,8 +467,6 @@ class Deva {
|
|
|
489
467
|
return this.Legal(); // go to Legal when Business is done.
|
|
490
468
|
}
|
|
491
469
|
} catch (e) {
|
|
492
|
-
this.action('error'); // set the action to error
|
|
493
|
-
this.feature('error'); // set the feature to error
|
|
494
470
|
return this.error(e); // run error handling if an error is caught
|
|
495
471
|
}
|
|
496
472
|
}
|
|
@@ -503,7 +479,6 @@ class Deva {
|
|
|
503
479
|
client presented data.
|
|
504
480
|
***************/
|
|
505
481
|
Legal() {
|
|
506
|
-
this.feature('Legal'); // set state to legal setting
|
|
507
482
|
const _cl = this.client(); // set hte local client variable
|
|
508
483
|
try {
|
|
509
484
|
if (!_cl.features.legal) this.Assistant(); // if no legal feature then move to assistant
|
|
@@ -523,8 +498,6 @@ class Deva {
|
|
|
523
498
|
return this.Assistant(); // when done goto Assis
|
|
524
499
|
}
|
|
525
500
|
} catch (e) {
|
|
526
|
-
this.action('error'); // set the action to error
|
|
527
|
-
this.feature('error'); // set the feature to error
|
|
528
501
|
return this.error(e); // run error handling if an error is caught
|
|
529
502
|
}
|
|
530
503
|
}
|
|
@@ -537,10 +510,9 @@ class Deva {
|
|
|
537
510
|
client presented data.
|
|
538
511
|
***************/
|
|
539
512
|
Assistant() {
|
|
540
|
-
this.feature('Assistant'); // set state to assistant setting
|
|
541
513
|
const _cl = this.client(); // set the client into a local variable
|
|
542
514
|
try {
|
|
543
|
-
if (!_cl.features.assistant) return this.
|
|
515
|
+
if (!_cl.features.assistant) return this.Artis(); // if no Assistant then goto Done
|
|
544
516
|
else {
|
|
545
517
|
this.action('Assistant'); // set action to Assistant
|
|
546
518
|
const {id, features, profile} = _cl; // set the local consts from client copy
|
|
@@ -554,45 +526,40 @@ class Deva {
|
|
|
554
526
|
personal: assistant.devas[this._agent.key] // Client personal features and rules.
|
|
555
527
|
};
|
|
556
528
|
delete this._client.features.assistant; // delete the assistant key from client features
|
|
557
|
-
return this.
|
|
529
|
+
return this.Artist(); // when assistant is done goto Artist.
|
|
558
530
|
}
|
|
559
531
|
} catch (e) {
|
|
560
|
-
this.action('error'); // set the action to error
|
|
561
|
-
this.feature('error'); // set the feature to error
|
|
562
532
|
return this.error(e); // run error handling if an error is caught
|
|
563
533
|
}
|
|
564
534
|
}
|
|
565
535
|
|
|
566
536
|
/**************
|
|
567
|
-
func:
|
|
537
|
+
func: Artist
|
|
568
538
|
params: client: false
|
|
569
539
|
describe:
|
|
570
|
-
The
|
|
540
|
+
The Artist feature sets the correct variables and necessary rules for the
|
|
571
541
|
client presented data.
|
|
572
542
|
***************/
|
|
573
|
-
|
|
574
|
-
this.feature('Story'); // set feature to Story
|
|
543
|
+
Artist() {
|
|
575
544
|
const _cl = this.client(); // set local client variable
|
|
576
545
|
try {
|
|
577
|
-
if (!this._client.features.
|
|
546
|
+
if (!this._client.features.artist) return this.Mind(); // if no artist goto Mind
|
|
578
547
|
else {
|
|
579
|
-
this.action('
|
|
548
|
+
this.action('Artist'); // set action to Artist
|
|
580
549
|
const {id, features, profile} = this._client; // set the local consts from client copy
|
|
581
|
-
const {
|
|
582
|
-
this.
|
|
583
|
-
id: this.uid(true), // uuid of the
|
|
550
|
+
const {artist} = features; // set artist from features const
|
|
551
|
+
this._artist = { // set this_artist with data
|
|
552
|
+
id: this.uid(true), // uuid of the artist feature
|
|
584
553
|
client_id: id, // client id for reference
|
|
585
554
|
client_name: profile.name, // client name for personalization
|
|
586
|
-
concerns:
|
|
587
|
-
global:
|
|
588
|
-
personal:
|
|
555
|
+
concerns: artist.concerns, // any concerns for client
|
|
556
|
+
global: artist.global, // the global policies for client
|
|
557
|
+
personal: artist.devas[this._agent.key], // Client personal features and rules.
|
|
589
558
|
};
|
|
590
|
-
delete this._client.features.
|
|
591
|
-
return this.Mind(); // when done with
|
|
559
|
+
delete this._client.features.artist; // delete artist object from client
|
|
560
|
+
return this.Mind(); // when done with artist goto Mind
|
|
592
561
|
}
|
|
593
562
|
} catch (e) {
|
|
594
|
-
this.action('error'); // set the action to error
|
|
595
|
-
this.feature('error'); // set the feature to error
|
|
596
563
|
return this.error(e); // run error handling if an error is caught
|
|
597
564
|
}
|
|
598
565
|
}
|
|
@@ -605,7 +572,6 @@ class Deva {
|
|
|
605
572
|
client presented data.
|
|
606
573
|
***************/
|
|
607
574
|
Mind() {
|
|
608
|
-
this.feature('Mind'); // set state to story setting
|
|
609
575
|
const _cl = this.client();
|
|
610
576
|
try {
|
|
611
577
|
if (!_cl.features.mind) return this.Done();
|
|
@@ -625,8 +591,6 @@ class Deva {
|
|
|
625
591
|
return this.Done(); // when complete then move to the done feature.
|
|
626
592
|
}
|
|
627
593
|
} catch (e) {
|
|
628
|
-
this.action('error'); // set the action to error
|
|
629
|
-
this.feature('error'); // set the feature to error
|
|
630
594
|
return this.error(e); // run error handling if an error is caught
|
|
631
595
|
}
|
|
632
596
|
}
|
|
@@ -640,11 +604,9 @@ class Deva {
|
|
|
640
604
|
return new Promise((resolve, reject) => {
|
|
641
605
|
try {
|
|
642
606
|
delete this._client.features; // delete the features key when done.
|
|
643
|
-
this.action('
|
|
644
|
-
this.feature('done'); // set state to assistant setting
|
|
607
|
+
this.action('Done'); // set state to assistant setting
|
|
645
608
|
return resolve(); // resolve an empty pr
|
|
646
609
|
} catch (e) {
|
|
647
|
-
this.feature('error')
|
|
648
610
|
return this.error(e, false, reject);
|
|
649
611
|
}
|
|
650
612
|
});
|
|
@@ -714,10 +676,9 @@ class Deva {
|
|
|
714
676
|
question(TEXT=false, DATA=false) {
|
|
715
677
|
// check the active status
|
|
716
678
|
if (!this._active) return Promise.resolve(this._messages.states.offline);
|
|
679
|
+
this.state('question');
|
|
717
680
|
const id = this.uid(); // generate a unique id for transport.
|
|
718
681
|
const t_split = TEXT.split(' '); // split the text on spaces to get words.
|
|
719
|
-
this.state('question');
|
|
720
|
-
this.action('question', id);
|
|
721
682
|
|
|
722
683
|
// check to see if the string is an #ask string to talk to the other Deva.
|
|
723
684
|
const isAsk = t_split[0].startsWith(this.askChr);
|
|
@@ -744,7 +705,7 @@ class Deva {
|
|
|
744
705
|
if (!TEXT) return this.finish(this._messages.notext, resolve);
|
|
745
706
|
// reject question if Deva offline
|
|
746
707
|
if (!this._active) return this.finish(this._messages.states.offline, resolve);
|
|
747
|
-
let _action = '
|
|
708
|
+
let _action = 'question'
|
|
748
709
|
try { // try to answer the question
|
|
749
710
|
if (isAsk) { // determine if hte question isAsk
|
|
750
711
|
_action = 'question_ask';
|
|
@@ -796,7 +757,6 @@ class Deva {
|
|
|
796
757
|
}
|
|
797
758
|
}
|
|
798
759
|
catch(e) { // try block error trap
|
|
799
|
-
this.action('error');
|
|
800
760
|
return this.error(e); // if a overall error happens this witll call this.error
|
|
801
761
|
}
|
|
802
762
|
});
|
|
@@ -814,13 +774,11 @@ class Deva {
|
|
|
814
774
|
***************/
|
|
815
775
|
answer(packet, resolve, reject) {
|
|
816
776
|
if (!this._active) return Promise.resolve(this._messages.states.offline);
|
|
817
|
-
|
|
818
777
|
this.state('answer');
|
|
819
778
|
// check if method exists and is of type function
|
|
820
779
|
const {method,params} = packet.q.meta;
|
|
821
780
|
const isMethod = this.methods[method] && typeof this.methods[method] == 'function';
|
|
822
781
|
if (!isMethod) {
|
|
823
|
-
this.action('invalid')
|
|
824
782
|
return resolve(this._methodNotFound(packet)); // resolve method not found if check if check fails
|
|
825
783
|
}
|
|
826
784
|
// Call the local method to process the question based the extracted parameters
|
|
@@ -862,7 +820,6 @@ class Deva {
|
|
|
862
820
|
|
|
863
821
|
return this.finish(packet, resolve) // resolve the packet to the caller.
|
|
864
822
|
}).catch(err => { // catch any errors in the method
|
|
865
|
-
this.action('error');
|
|
866
823
|
return this.error(err, packet, reject); // return this.error with err, packet, reject
|
|
867
824
|
});
|
|
868
825
|
}
|
|
@@ -927,13 +884,11 @@ class Deva {
|
|
|
927
884
|
this.action('ask_answer');
|
|
928
885
|
this.talk(`${agent.key}:ask:${packet.id}`, packet);
|
|
929
886
|
}).catch(err => {
|
|
930
|
-
this.action('error');
|
|
931
887
|
this.talk(`${agent.key}:ask:${packet.id}`, {error:err});
|
|
932
888
|
return this.error(err, packet);
|
|
933
889
|
})
|
|
934
890
|
}
|
|
935
891
|
catch (e) {
|
|
936
|
-
this.action('error');
|
|
937
892
|
this.talk(`${agent.key}:ask:${packet.id}`, {error:e});
|
|
938
893
|
return this.error(e, packet)
|
|
939
894
|
}
|
|
@@ -1147,7 +1102,7 @@ class Deva {
|
|
|
1147
1102
|
this._business = false;
|
|
1148
1103
|
this._development = false;
|
|
1149
1104
|
this._legal = false;
|
|
1150
|
-
this.
|
|
1105
|
+
this._artist = false;
|
|
1151
1106
|
|
|
1152
1107
|
this.action(data.value);
|
|
1153
1108
|
const hasOnExit = this.onExit && typeof this.onExit === 'function';
|
|
@@ -1232,7 +1187,7 @@ class Deva {
|
|
|
1232
1187
|
id: this.uid(true),
|
|
1233
1188
|
key: 'zones',
|
|
1234
1189
|
value: this._zones,
|
|
1235
|
-
messages: this.
|
|
1190
|
+
messages: this._messages.zones,
|
|
1236
1191
|
created: Date.now(),
|
|
1237
1192
|
}
|
|
1238
1193
|
}
|
|
@@ -1269,7 +1224,7 @@ class Deva {
|
|
|
1269
1224
|
id: this.uid(true),
|
|
1270
1225
|
key: 'actions',
|
|
1271
1226
|
value: this._actions,
|
|
1272
|
-
messages: this.
|
|
1227
|
+
messages: this._messages.actions,
|
|
1273
1228
|
created: Date.now(),
|
|
1274
1229
|
}
|
|
1275
1230
|
}
|
|
@@ -1306,7 +1261,7 @@ class Deva {
|
|
|
1306
1261
|
id: this.uid(true),
|
|
1307
1262
|
key: 'features',
|
|
1308
1263
|
value: this._features,
|
|
1309
|
-
messages: this.
|
|
1264
|
+
messages: this._messages.features,
|
|
1310
1265
|
created: Date.now(),
|
|
1311
1266
|
}
|
|
1312
1267
|
}
|
|
@@ -1399,8 +1354,6 @@ class Deva {
|
|
|
1399
1354
|
this.action('security'); // set the security state
|
|
1400
1355
|
return this.copy(this._security); // return the security feature
|
|
1401
1356
|
} catch (e) {
|
|
1402
|
-
this.action('error'); // set the security state
|
|
1403
|
-
this.feature('error');
|
|
1404
1357
|
return this.error(e);
|
|
1405
1358
|
}
|
|
1406
1359
|
}
|
|
@@ -1418,8 +1371,6 @@ class Deva {
|
|
|
1418
1371
|
this.action('support');
|
|
1419
1372
|
return this.copy(this._support); // return the support feature
|
|
1420
1373
|
} catch (e) {
|
|
1421
|
-
this.action('error'); // set the services state
|
|
1422
|
-
this.feature('error');
|
|
1423
1374
|
return this.error(e);
|
|
1424
1375
|
}
|
|
1425
1376
|
}
|
|
@@ -1437,8 +1388,6 @@ class Deva {
|
|
|
1437
1388
|
this.action('services'); // set the services state
|
|
1438
1389
|
return this.copy(this._services); // return the services feature
|
|
1439
1390
|
} catch (e) {
|
|
1440
|
-
this.action('error'); // set the services state
|
|
1441
|
-
this.feature('error');
|
|
1442
1391
|
return this.error(e);
|
|
1443
1392
|
}
|
|
1444
1393
|
}
|
|
@@ -1456,8 +1405,6 @@ class Deva {
|
|
|
1456
1405
|
this.action('systems'); // set the systems state
|
|
1457
1406
|
return this.copy(this._systems); // return the systems feature
|
|
1458
1407
|
} catch (e) {
|
|
1459
|
-
this.action('error'); // set the systems state
|
|
1460
|
-
this.feature('error');
|
|
1461
1408
|
return this.error(e)
|
|
1462
1409
|
}
|
|
1463
1410
|
}
|
|
@@ -1475,8 +1422,6 @@ class Deva {
|
|
|
1475
1422
|
this.action('solutions'); // set the solutions state
|
|
1476
1423
|
return this.copy(this._solutions); // return the solutions feature
|
|
1477
1424
|
} catch (e) {
|
|
1478
|
-
this.action('error'); // set the systems state
|
|
1479
|
-
this.feature('error');
|
|
1480
1425
|
return this.error(e);
|
|
1481
1426
|
}
|
|
1482
1427
|
}
|
|
@@ -1493,8 +1438,6 @@ class Deva {
|
|
|
1493
1438
|
this.action('research'); // set the research state
|
|
1494
1439
|
return this.copy(this._research); // return research feature
|
|
1495
1440
|
} catch (e) {
|
|
1496
|
-
this.action('error');
|
|
1497
|
-
this.feature('error');
|
|
1498
1441
|
return this.error(e);
|
|
1499
1442
|
}
|
|
1500
1443
|
}
|
|
@@ -1511,8 +1454,6 @@ class Deva {
|
|
|
1511
1454
|
this.action('development'); // set the development state
|
|
1512
1455
|
return this.copy(this._development); // return development feature
|
|
1513
1456
|
} catch (e) {
|
|
1514
|
-
this.action('error');
|
|
1515
|
-
this.feature('error');
|
|
1516
1457
|
return this.error(e);
|
|
1517
1458
|
}
|
|
1518
1459
|
}
|
|
@@ -1529,8 +1470,6 @@ class Deva {
|
|
|
1529
1470
|
this.action('assistant'); // set the assistant state
|
|
1530
1471
|
return this.copy(this._assistant); // return assistant feature
|
|
1531
1472
|
} catch (e) {
|
|
1532
|
-
this.action('error');
|
|
1533
|
-
this.feature('error');
|
|
1534
1473
|
return this.error(e);
|
|
1535
1474
|
}
|
|
1536
1475
|
}
|
|
@@ -1547,8 +1486,6 @@ class Deva {
|
|
|
1547
1486
|
this.action('business');
|
|
1548
1487
|
return this.copy(this._business); // return business feature
|
|
1549
1488
|
} catch (e) {
|
|
1550
|
-
this.action('error');
|
|
1551
|
-
this.feature('error');
|
|
1552
1489
|
return this.error('error');
|
|
1553
1490
|
}
|
|
1554
1491
|
}
|
|
@@ -1565,26 +1502,22 @@ class Deva {
|
|
|
1565
1502
|
this.action('legal');
|
|
1566
1503
|
return this.copy(this._legal); // return legal feature
|
|
1567
1504
|
} catch (e) {
|
|
1568
|
-
this.action('error');
|
|
1569
|
-
this.feature('error');
|
|
1570
1505
|
return this.error(e);
|
|
1571
1506
|
}
|
|
1572
1507
|
}
|
|
1573
1508
|
|
|
1574
1509
|
/**************
|
|
1575
|
-
func:
|
|
1510
|
+
func: artist
|
|
1576
1511
|
params: opts
|
|
1577
|
-
describe: basic
|
|
1512
|
+
describe: basic artist features available in a Deva.
|
|
1578
1513
|
***************/
|
|
1579
|
-
|
|
1514
|
+
artist(opts) {
|
|
1580
1515
|
if (!this._active) return this._messages.states.offline; // chek the active status
|
|
1581
|
-
this.feature('
|
|
1516
|
+
this.feature('artist'); // set the artist state
|
|
1582
1517
|
try {
|
|
1583
|
-
this.action('
|
|
1584
|
-
return this.
|
|
1518
|
+
this.action('artist');
|
|
1519
|
+
return this.artist(this._artist); // return artist feature
|
|
1585
1520
|
} catch (e) {
|
|
1586
|
-
this.action('error');
|
|
1587
|
-
this.feature('error');
|
|
1588
1521
|
return this.error(e);
|
|
1589
1522
|
}
|
|
1590
1523
|
}
|