@indra.ai/deva 1.5.54 โ†’ 1.5.55

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/index.js CHANGED
@@ -19,6 +19,7 @@ class Deva {
19
19
  this._active = false; // the active/birth date.
20
20
  this._vector = false; // inherited Vector features.
21
21
  this._veda = false; // inherited Veda features.
22
+ this._god = false; // inherited God features.
22
23
  this._king = false; // inherited King features.
23
24
  this._treasury = false; // inherited Vector features.
24
25
  this._security = false; // inherited Security features.
@@ -34,7 +35,7 @@ class Deva {
34
35
  this._systems = false; // inherited Systems features.
35
36
  this._networks = false; // inherited Systems features.
36
37
  this.events = opts.events || new EventEmitter({}); // Event Bus
37
- this.lib = new lib({}); // used for loading library functions
38
+ this.lib = new lib({config}); // used for loading library functions
38
39
  this.utils = opts.utils || {}; // parse function
39
40
  this.devas = opts.devas || {}; // Devas which are loaded
40
41
  this.vars = opts.vars || {}; // Variables object
@@ -204,7 +205,7 @@ class Deva {
204
205
  packet.sha256 = this.lib.hash(packet, 'sha256');
205
206
  packet.sha512 = this.lib.hash(packet, 'sha512');
206
207
 
207
- this.state('invalid', `${meta.method}:${packet.id}`);
208
+ this.state('invalid', `${meta.method}:${packet.id.uid}`);
208
209
  return packet;
209
210
  }
210
211
 
@@ -267,19 +268,19 @@ class Deva {
267
268
  ***************/
268
269
  Feature(feature, resolve, reject) {
269
270
  const _id = this.lib.uid();
270
- this.feature(feature, _id);
271
- this.zone(feature, _id);
271
+ this.feature(feature, _id.uid);
272
+ this.zone(feature, _id.uid);
272
273
  const _cl = this.client(); // set local copy of client data
273
274
  try {
274
275
  if (!_cl.features[feature]) return resolve(); // if no security feature goto Support
275
276
  else {
276
- this.action(feature, _id); // set action to feature
277
+ this.action(feature, _id.uid); // set action to feature
277
278
  const _fe = `_${feature}`;
278
279
  const {id, profile, features} = _cl; // make a copy the clinet data.
279
280
  const data = features[feature]; // make a copy the clinet data.
280
281
  this.state('set', `feature:${id}`);
281
- this[_fe] = { // set this_security with data
282
- id: _id, // uuid of the security feature
282
+ this[_fe] = { // set this feature with data
283
+ id: _id, // uid of the feature
283
284
  client_id: id, // client id for reference
284
285
  client_name: profile.name, // client name for personalization
285
286
  concerns: data.concerns, // any concerns for client
@@ -288,11 +289,11 @@ class Deva {
288
289
  created: Date.now(),
289
290
  };
290
291
  delete this._client.features[feature]; // make a copy the clinet data.
291
- this.state('resolve', `${feature}:${_id}`);
292
+ this.state('resolve', `${feature}:${_id.uid}`);
292
293
  return resolve(feature); // resolve when done
293
294
  }
294
295
  } catch (e) {
295
- this.state('catch', `${feature}:${_id}`);
296
+ this.state('catch', `${feature}:${_id.uid}`);
296
297
  return this.error(e, feature, reject); // run error handling if an error is caught
297
298
  }
298
299
  }
@@ -319,6 +320,17 @@ class Deva {
319
320
  return this.Feature('veda', resolve, reject);
320
321
  }
321
322
 
323
+ /**************
324
+ func: God
325
+ params: resolve, reject
326
+ describe:
327
+ The God feature sets the correct variables and necessary rules for the
328
+ client presented data.
329
+ ***************/
330
+ God(resolve, reject) {
331
+ return this.Feature('god', resolve, reject);
332
+ }
333
+
322
334
  /**************
323
335
  func: King
324
336
  params: resolve, reject
@@ -510,7 +522,7 @@ class Deva {
510
522
  to create seamless collaboration between Devas.
511
523
  ***************/
512
524
  talk(evt, packet=false) {
513
- this.action('talk', `${evt}:${packet.id}`);
525
+ this.action('talk', `${evt}:${packet.id.uid}`);
514
526
  return this.events.emit(evt, packet);
515
527
  }
516
528
 
@@ -637,14 +649,14 @@ class Deva {
637
649
  if (isAsk) { // isAsk check if the question isAsk and talk
638
650
  // if: isAsk wait for the once event which is key'd to the packet ID for specified responses
639
651
  this.talk(`${key}:ask`, packet);
640
- this.once(`${key}:ask:${packet.id}`, answer => {
652
+ this.once(`${key}:ask:${packet.id.uid}`, answer => {
641
653
  this.talk(config.events.ask, this.lib.copy(answer));
642
- this.state('return', `${key}:ask:${id}`);
654
+ this.state('return', `${key}:ask:${packet.id.uid}`);
643
655
  return this.finish(answer, resolve); // if:isAsk resolve the answer from the call
644
656
  });
645
657
  }
646
658
  else { // else: answer the question locally
647
- this.state('answer', `${method}:${id}`); //set the answer state to the method
659
+ this.state('answer', `${method}:${id.uid}`); //set the answer state to the method
648
660
  return this.answer(packet, resolve, reject);
649
661
  }
650
662
  }
@@ -743,18 +755,18 @@ class Deva {
743
755
  const agent = this.agent();
744
756
  const client = this.client();
745
757
  const {method, params} = packet.q.meta;
746
- this.zone('ask', `${method}:${packet.id}`);
747
- this.action('ask', `${method}:${packet.id}`);
758
+ this.zone('ask', `${method}:${packet.id.uid}`);
759
+ this.action('ask', `${method}:${packet.id.uid}`);
748
760
  // build the answer packet from this model
749
- this.state('try', `ask:${method}:${packet.id}`);
761
+ this.state('try', `ask:${method}:${packet.id.uid}`);
750
762
  try {
751
763
  if (typeof this.methods[method] !== 'function') {
752
764
  return setImmediate(() => {
753
- this.talk(`${this._agent.key}:ask:${packet.id}`, this._methodNotFound(packet));
765
+ this.talk(`${this._agent.key}:ask:${packet.id.uid}`, this._methodNotFound(packet));
754
766
  });
755
767
  }
756
768
 
757
- this.state('set', `ask:${method}:packet_answer:${packet.id}`);
769
+ this.state('set', `ask:${method}:packet_answer:${packet.id.uid}`);
758
770
  const packet_answer = {
759
771
  id: this.lib.uid(),
760
772
  agent,
@@ -787,16 +799,16 @@ class Deva {
787
799
 
788
800
  packet.a = packet_answer;
789
801
  this.talk(config.events.answer, this.lib.copy(packet)); // global talk event
790
- this.talk(`${agent.key}:ask:${packet.id}`, packet);
802
+ this.talk(`${agent.key}:ask:${packet.id.uid}`, packet);
791
803
  }).catch(err => {
792
- this.talk(`${agent.key}:ask:${packet.id}`, {error:err});
793
- this.state('catch', `ask:${method}:${packet.id}`);
804
+ this.talk(`${agent.key}:ask:${packet.id.uid}`, {error:err});
805
+ this.state('catch', `ask:${method}:${packet.id.uid}`);
794
806
  return this.error(err, packet);
795
807
  })
796
808
  }
797
809
  catch (e) {
798
- this.state('catch', `ask:${method}:${packet.id}`);
799
- this.talk(`${agent.key}:ask:${packet.id}`, {error:e});
810
+ this.state('catch', `ask:${method}:${packet.id.uid}`);
811
+ this.talk(`${agent.key}:ask:${packet.id.uid}`, {error:e});
800
812
  return this.error(e, packet)
801
813
  }
802
814
  // now when we ask the meta params[0] should be the method
@@ -852,6 +864,8 @@ class Deva {
852
864
  return this.Vector(resolve, reject);
853
865
  }).then(() => {
854
866
  return this.Veda(resolve, reject);
867
+ }).then(() => {
868
+ return this.God(resolve, reject);
855
869
  }).then(() => {
856
870
  return this.King(resolve, reject);
857
871
  }).then(() => {
@@ -886,10 +900,10 @@ class Deva {
886
900
  return this.Done(resolve, reject);
887
901
  }).then(() => {
888
902
  const hasOnInit = this.onInit && typeof this.onInit === 'function';
889
- this.state('return', `init:${data.id}`);
903
+ this.state('return', `init:${data.id.uid}`);
890
904
  return hasOnInit ? this.onInit(data, resolve) : this.start(data, resolve);
891
905
  }).catch(err => {
892
- this.state('catch', `init:${data.id}`);
906
+ this.state('catch', `init:${data.id.uid}`);
893
907
  return this.error(err, client, reject);
894
908
  });
895
909
  });
@@ -906,10 +920,10 @@ class Deva {
906
920
  usage: this.start('msg')
907
921
  ***************/
908
922
  start(data, resolve) {
909
- this.zone('start', data.id);
923
+ this.zone('start', data.id.uid);
910
924
  if (!this._active) return resolve(this._messages.offline);
911
925
 
912
- this.action('start', data.id);
926
+ this.action('start', data.id.uid);
913
927
  const id = this.lib.uid();
914
928
 
915
929
  delete data.md5;
@@ -924,7 +938,7 @@ class Deva {
924
938
 
925
939
  const hasOnStart = this.onStart && typeof this.onStart === 'function' ? true : false;
926
940
 
927
- this.state('start', data.id);
941
+ this.state('start', data.id.uid);
928
942
  this.talk(config.events.start, data);
929
943
  return hasOnStart ? this.onStart(data, resolve) : this.enter(data, resolve)
930
944
  }
@@ -941,10 +955,10 @@ class Deva {
941
955
  usage: this.enter('msg')
942
956
  ***************/
943
957
  enter(data, resolve) {
944
- this.zone('enter', data.id);
958
+ this.zone('enter', data.id.uid);
945
959
  if (!this._active) return resolve(this._messages.offline);
946
960
 
947
- this.action('enter', data.id);
961
+ this.action('enter', data.id.uid);
948
962
  const hasOnEnter = this.onEnter && typeof this.onEnter === 'function' ? true : false;
949
963
 
950
964
  delete data.md5;
@@ -957,7 +971,7 @@ class Deva {
957
971
  data.sha256 = this.lib.hash(data, 'sha256');
958
972
  data.sha512 = this.lib.hash(data, 'sha512');
959
973
 
960
- this.state('enter', data.id);
974
+ this.state('enter', data.id.uid);
961
975
  this.talk(config.events.enter, data);
962
976
  return hasOnEnter ? this.onEnter(data, resolve) : this.done(data, resolve)
963
977
  }
@@ -974,10 +988,10 @@ class Deva {
974
988
  usage: this.done('msg')
975
989
  ***************/
976
990
  done(data, resolve) {
977
- this.zone('done', data.id);
991
+ this.zone('done', data.id.uid);
978
992
  if (!this._active) return resolve(this._messages.offline);
979
993
 
980
- this.action('done', data.id);
994
+ this.action('done', data.id.uid);
981
995
  const hasOnDone = this.onDone && typeof this.onDone === 'function' ? true : false;
982
996
 
983
997
  delete data.md5;
@@ -990,7 +1004,7 @@ class Deva {
990
1004
  data.sha256 = this.lib.hash(data, 'sha256');
991
1005
  data.sha512 = this.lib.hash(data, 'sha512');
992
1006
 
993
- this.state('done', data.id);
1007
+ this.state('done', data.id.uid);
994
1008
  this.talk(config.events.done, data);
995
1009
  return hasOnDone ? this.onDone(data, resolve) : this.ready(data, resolve);
996
1010
  }
@@ -1004,10 +1018,10 @@ class Deva {
1004
1018
  usage: this.ready(data, resolve)
1005
1019
  ***************/
1006
1020
  ready(data, resolve) {
1007
- this.zone('ready', data.id);
1021
+ this.zone('ready', data.id.uid);
1008
1022
  if (!this._active) return resolve(this._messages.offline);
1009
1023
 
1010
- this.action('ready', data.id);
1024
+ this.action('ready', data.id.uid);
1011
1025
  const hasOnReady = this.onReady && typeof this.onReady === 'function';
1012
1026
 
1013
1027
  delete data.md5;
@@ -1020,7 +1034,7 @@ class Deva {
1020
1034
  data.sha256 = this.lib.hash(data, 'sha256');
1021
1035
  data.sha512 = this.lib.hash(data, 'sha512');
1022
1036
 
1023
- this.state('ready', data.id);
1037
+ this.state('ready', data.id.uid);
1024
1038
  this.talk(config.events.ready, data);
1025
1039
  return hasOnReady ? this.onReady(data, resolve) : resolve(data);
1026
1040
  }
@@ -1036,10 +1050,10 @@ class Deva {
1036
1050
  usage: this.finish(data, resolve)
1037
1051
  ***************/
1038
1052
  finish(data, resolve) {
1039
- this.zone('finish', data.id); // enter finish zone
1053
+ this.zone('finish', data.id.uid); // enter finish zone
1040
1054
  if (!this._active) return resolve(this._messages.offline); //
1041
1055
 
1042
- this.action('finish', data.id); // start finish action
1056
+ this.action('finish', data.id.uid); // start finish action
1043
1057
  const hasOnFinish = this.onFinish && typeof this.onFinish === 'function';
1044
1058
 
1045
1059
  delete data.md5;
@@ -1052,7 +1066,7 @@ class Deva {
1052
1066
  data.sha256 = this.lib.hash(data, 'sha256');
1053
1067
  data.sha512 = this.lib.hash(data, 'sha512');
1054
1068
 
1055
- this.state('finish', data.id); // set finish state
1069
+ this.state('finish', data.id.uid); // set finish state
1056
1070
  this.talk(config.events.finish, data);
1057
1071
  return hasOnFinish ? this.onFinish(data, resolve) : this.complete(data, resolve);
1058
1072
  }
@@ -1067,10 +1081,10 @@ class Deva {
1067
1081
  usage: this.complete(data, resolve)
1068
1082
  ***************/
1069
1083
  complete(data, resolve) {
1070
- this.zone('complete', data.id);
1084
+ this.zone('complete', data.id.uid);
1071
1085
  if (!this._active) return Promise.resolve(this._messages.offline);
1072
1086
 
1073
- this.action('complete', data.id);
1087
+ this.action('complete', data.id.uid);
1074
1088
  const hasOnComplete = this.onComplete && typeof this.onComplete === 'function';
1075
1089
 
1076
1090
  delete data.md5;
@@ -1082,7 +1096,7 @@ class Deva {
1082
1096
  data.sha256 = this.lib.hash(data, 'sha256');
1083
1097
  data.sha512 = this.lib.hash(data, 'sha512');
1084
1098
 
1085
- this.state('complete', data.id);
1099
+ this.state('complete', data.id.uid);
1086
1100
  this.talk(config.events.complete, data);
1087
1101
  return hasOnComplete ? this.onComplete(data, resolve) : resolve(data);
1088
1102
  }
@@ -1466,7 +1480,7 @@ class Deva {
1466
1480
  this.talk(config.events.context, data);
1467
1481
  return data;
1468
1482
  } catch (e) {
1469
- this.state('catch', `context:${value}:${id}`);
1483
+ this.state('catch', `context:${value}:${id.guid}`);
1470
1484
  return this.error(e, value);
1471
1485
  }
1472
1486
  }
@@ -1539,6 +1553,16 @@ class Deva {
1539
1553
  return this._getFeature('veda', this._vector);
1540
1554
  }
1541
1555
 
1556
+ /**************
1557
+ func: god
1558
+ params: none
1559
+ describe: basic god features available in a Deva.
1560
+ usage: this.god()
1561
+ ***************/
1562
+ god() {
1563
+ return this._getFeature('god', this._vector);
1564
+ }
1565
+
1542
1566
  /**************
1543
1567
  func: king
1544
1568
  params: none
@@ -1787,7 +1811,7 @@ class Deva {
1787
1811
  data.sha256 = this.lib.hash(data, 'sha256');
1788
1812
  data.sha512 = this.lib.hash(data, 'sha512');
1789
1813
 
1790
- this.state('return', `core:${id}`);
1814
+ this.state('return', `core:${id.uid}`);
1791
1815
  return data;
1792
1816
  }
1793
1817
 
@@ -1809,7 +1833,7 @@ class Deva {
1809
1833
  data.sha256 = this.lib.hash(data, 'sha256');
1810
1834
  data.sha512 = this.lib.hash(data, 'sha512');
1811
1835
 
1812
- this.state('return', `info:${id}`);
1836
+ this.state('return', `info:${id.uid}`);
1813
1837
  return data;
1814
1838
  }
1815
1839
 
package/lib/index.js CHANGED
@@ -15,6 +15,7 @@ class Node {
15
15
  }
16
16
  class LIB {
17
17
  constructor(opts) {
18
+ this.config = opts.config || {};
18
19
  this.lang = opts.lang || 'en';
19
20
  this.locale = opts.locale || 'en-US';
20
21
  this.currency = opts.currency || 'USD';
@@ -48,23 +49,38 @@ class LIB {
48
49
  describe:
49
50
  The uid function can create two types of id for you.
50
51
  1. random GUID - this is good for when you need a uinique record id returned
51
- 2. transport id - The transport id is a number generated to provide a
52
+ 2. transport uid - The transport id is a number generated to provide a
52
53
  secure numerical number used for transporting records
53
54
  across networks without collision or needing to store system uuid.
55
+ 3. the uid is then returned with a created, md5, sha256, and sha512 hash of the value
54
56
  copyright: 2025 Quinn A Michaels. All rights reserved.
55
57
  ***************/
56
58
  uid(guid=false) {
57
59
  const time = Date.now();
58
60
  if (guid) {
59
- const guid = randomUUID(); // set guid into local variable for testing.
60
- return guid; // return the guid.
61
+ const uid = randomUUID(); // set uid into local constant.
62
+ const created = Date.now(); // set created into local constant.
63
+ const data = {uid,created}; // set base data object.
64
+ data.md5 = this.hash(data, 'md5'); // md5 the uid and created.
65
+ data.sha256 = this.hash(data, 'sha256'); // sha256 the uid, created, md5
66
+ data.sha512 = this.hash(data, 'sha512'); // sha512 the uid, created, md5, sha256.
67
+ return data; // return the data.
61
68
  }
62
69
  else {
63
70
  const min = Math.floor(time - (time / Math.PI)); // generate min time from Math.PI divisor.
64
71
  const max = Math.ceil(time + (time * Math.PI)); // generate max time form Math.PI multiplier.
65
72
  const begin_random = Math.floor(Math.random() * (max - min) + min); // generate random number between min and max.
66
- const end_random = Math.ceil(Math.random() * (99999 - 10000) + 10000); // generate the 5 digit end salt on the number for added randomness.
67
- return `${begin_random}${end_random}`; // return the complete random uid.
73
+ const {end_min, end_max} = this.config.uid; // set end min and max in to constant
74
+ const end_random = Math.ceil(Math.random() * (end_max - end_min) + end_min); // generate the 5 digit end salt on the number for added randomness.
75
+
76
+ const uid = `${begin_random}${end_random}`; // set uid to local constant
77
+ const created = Date.now(); // set created to local constant
78
+
79
+ const data = {uid,created}; // set base data object.
80
+ data.md5 = this.hash(data, 'md5'); // md5 the uid and created.
81
+ data.sha256 = this.hash(data, 'sha256'); // sha256 the uid, created, md5
82
+ data.sha512 = this.hash(data, 'sha512'); // sha512 the uid, created, md5, sha256.
83
+ return data; // return the complete uid data.
68
84
  }
69
85
  }
70
86
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "id": "9f0bc743-d720-4320-832e-cf5edc3b7cf",
3
3
  "name": "@indra.ai/deva",
4
- "version": "1.5.54",
4
+ "version": "1.5.55",
5
5
  "description": "The Deva Core",
6
6
  "main": "index.js",
7
7
  "copyright": "(c)2025 Quinn Michaels; All rights reserved.",
@@ -53,6 +53,10 @@
53
53
  "config": {
54
54
  "cmdChr": "/",
55
55
  "askChr": "#",
56
+ "uid": {
57
+ "end_min": 1000000,
58
+ "end_max": 9999999
59
+ },
56
60
  "inherit": [
57
61
  "events",
58
62
  "lib",
@@ -95,7 +99,7 @@
95
99
  "ask": "๐Ÿ“ฃ Ask",
96
100
  "load": "๐Ÿš› Load",
97
101
  "unload": "๐Ÿ›ป Unload",
98
- "init": "๐ŸŸ  Init",
102
+ "init": "๐ŸŸ  Init",
99
103
  "start": "๐ŸŸข Start",
100
104
  "enter": "๐Ÿšช Enter",
101
105
  "done": "โ˜‘๏ธ Done",
@@ -108,6 +112,7 @@
108
112
  "agent": "๐Ÿค– Agent",
109
113
  "client": "๐Ÿ‘จ Client",
110
114
  "vector": "๐Ÿ›ค๏ธ Vector",
115
+ "god": "๐Ÿ’ซ God",
111
116
  "veda": "๐Ÿ•‰๏ธ Veda",
112
117
  "king": "๐Ÿ‘‘๏ธ King",
113
118
  "treasury": "๐Ÿฆ๏ธ Treasury",
@@ -147,7 +152,7 @@
147
152
  "disconnect": "๐Ÿ“ด Disconnect",
148
153
  "send": "๐Ÿ“ฌ Send",
149
154
  "receive": "๐Ÿ“ช Receive",
150
- "init": "๐ŸŸ  Init",
155
+ "init": "๐ŸŸ  Init",
151
156
  "start": "๐ŸŸข Start",
152
157
  "enter": "๐Ÿšช Enter",
153
158
  "done": "โ˜‘๏ธ Done",
@@ -210,6 +215,7 @@
210
215
  "client": "๐Ÿ‘จ Client",
211
216
  "agent": "๐Ÿ•ต๏ธโ€โ™‚๏ธ Agent",
212
217
  "vector": "๐Ÿ‘ฝ Vector",
218
+ "god": "๐Ÿ’ซ God",
213
219
  "veda": "๐Ÿ•‰๏ธ Veda",
214
220
  "king": "๐Ÿ‘‘๏ธ King",
215
221
  "security": "๐Ÿšจ Security",
@@ -233,7 +239,7 @@
233
239
  "question": "๐Ÿ™‹ Question",
234
240
  "answer": "๐Ÿ’ก Answer",
235
241
  "ask": "๐Ÿ“ฃ Ask",
236
- "init": "๐ŸŸ  Init",
242
+ "init": "๐ŸŸ  Init",
237
243
  "start": "๐ŸŸข Start",
238
244
  "enter": "๐Ÿšช Enter",
239
245
  "finish": "๐Ÿ Finish",
@@ -259,10 +265,11 @@
259
265
  },
260
266
  "feature": false,
261
267
  "features": {
262
- "init": "๐ŸŸ  Init",
268
+ "init": "๐ŸŸ  Init",
263
269
  "agent": "๐Ÿฆพ Agent",
264
270
  "client": "๐Ÿ’ช Client",
265
271
  "vector": "๐Ÿ›ค๏ธ Vector",
272
+ "god": "๐Ÿ’ซ God",
266
273
  "veda": "๐Ÿ•‰๏ธ Veda",
267
274
  "king": "๐Ÿ‘‘๏ธ King",
268
275
  "treasury": "๐Ÿฆ Treasury",
package/tests/client.json CHANGED
@@ -34,17 +34,22 @@
34
34
  "currency": "USD"
35
35
  },
36
36
  "features": {
37
+ "vector": {
38
+ "concerns": [],
39
+ "global": [],
40
+ "devas": {}
41
+ },
37
42
  "veda": {
38
43
  "concerns": [],
39
44
  "global": [],
40
45
  "devas": {}
41
46
  },
42
- "king": {
47
+ "god": {
43
48
  "concerns": [],
44
49
  "global": [],
45
50
  "devas": {}
46
51
  },
47
- "vector": {
52
+ "king": {
48
53
  "concerns": [],
49
54
  "global": [],
50
55
  "devas": {}
package/tests/index.js CHANGED
@@ -110,12 +110,12 @@ const DevaTest = new Deva({
110
110
  const info = this.info();
111
111
  const data = [
112
112
  '๐Ÿงช TEST RESULTS',
113
- `::BEGIN:CORE:${core.id}`,
113
+ `::BEGIN:CORE:${core.id.uid}`,
114
114
  JSON.stringify(core,null,2),
115
- `::END:CORE:${core.id}`,
116
- `::BEGIN:INFO:${info.id}`,
115
+ `::END:CORE:${core.id.uid}`,
116
+ `::BEGIN:INFO:${info.id.uid}`,
117
117
  JSON.stringify(info,null,2),
118
- `::END:INFO:${info.id}`,
118
+ `::END:INFO:${info.id.uid}`,
119
119
  ];
120
120
  return {
121
121
  text: data.join('\n'),
@@ -130,19 +130,19 @@ const DevaTest = new Deva({
130
130
  }
131
131
  },
132
132
  onStart(data, resolve) {
133
- this.context('start', data.id);
133
+ this.context('start', data.id.uid);
134
134
  return this.enter(data, resolve);
135
135
  },
136
136
  onEnter(data, resolve) {
137
- this.context('enter', data.id);
137
+ this.context('enter', data.id.uid);
138
138
  return this.done(data, resolve);
139
139
  },
140
140
  onDone(data, resolve) {
141
- this.context('done', data.id);
141
+ this.context('done', data.id.uid);
142
142
  return this.ready(data, resolve);
143
143
  },
144
144
  onReady(data, resolve) {
145
- this.context('ready', data.id);
145
+ this.context('ready', data.id.uid);
146
146
  const test = this.methods.test(data);
147
147
  this.prompt(test.text);
148
148
  setTimeout(() => {
@@ -150,11 +150,11 @@ const DevaTest = new Deva({
150
150
  }, 10000);
151
151
  },
152
152
  onFinish(data, resolve) {
153
- this.context('finish', data.id);
153
+ this.context('finish', data.id.uid);
154
154
  return this.complete(data, resolve);
155
155
  },
156
156
  onComplete(data, resolve) {
157
- this.context('complete', data.id);
157
+ this.context('complete', data.id.uid);
158
158
  return resolve(data);
159
159
  },
160
160
  onError(e) {