@indra.ai/deva 1.5.52 โ†’ 1.5.54

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
@@ -18,6 +18,8 @@ class Deva {
18
18
  this._client = {}; // this will be set on init.
19
19
  this._active = false; // the active/birth date.
20
20
  this._vector = false; // inherited Vector features.
21
+ this._veda = false; // inherited Veda features.
22
+ this._king = false; // inherited King features.
21
23
  this._treasury = false; // inherited Vector features.
22
24
  this._security = false; // inherited Security features.
23
25
  this._guard = false; // inherited Guard features.
@@ -297,7 +299,7 @@ class Deva {
297
299
 
298
300
  /**************
299
301
  func: Vector
300
- params: client: false
302
+ params: resolve, reject
301
303
  describe:
302
304
  The Vector feature sets the correct variables and necessary rules for the
303
305
  client presented data.
@@ -306,9 +308,31 @@ class Deva {
306
308
  return this.Feature('vector', resolve, reject);
307
309
  }
308
310
 
311
+ /**************
312
+ func: Veda
313
+ params: resolve, reject
314
+ describe:
315
+ The Veda feature sets the correct variables and necessary rules for the
316
+ client presented data.
317
+ ***************/
318
+ Veda(resolve, reject) {
319
+ return this.Feature('veda', resolve, reject);
320
+ }
321
+
322
+ /**************
323
+ func: King
324
+ params: resolve, reject
325
+ describe:
326
+ The King feature sets the correct variables and necessary rules for the
327
+ client presented data.
328
+ ***************/
329
+ King(resolve, reject) {
330
+ return this.Feature('king', resolve, reject);
331
+ }
332
+
309
333
  /**************
310
334
  func: Treasury
311
- params: client: false
335
+ params: resolve, reject
312
336
  describe:
313
337
  The Treasury feature sets the correct variables and necessary rules for the
314
338
  client presented data.
@@ -319,7 +343,7 @@ class Deva {
319
343
 
320
344
  /**************
321
345
  func: Security
322
- params: client: false
346
+ params: resolve, reject
323
347
  describe:
324
348
  The Security feature sets the correct variables and necessary rules for the
325
349
  client presented data.
@@ -330,7 +354,7 @@ class Deva {
330
354
 
331
355
  /**************
332
356
  func: Guard
333
- params: client: false
357
+ params: resolve, reject
334
358
  describe:
335
359
  The Guard feature sets the correct variables and necessary rules for the
336
360
  client presented data.
@@ -341,7 +365,7 @@ class Deva {
341
365
 
342
366
  /**************
343
367
  func: Defense
344
- params: client: false
368
+ params: resolve, reject
345
369
  describe:
346
370
  The Defense feature sets the correct variables and necessary rules for the
347
371
  client presented data.
@@ -352,7 +376,7 @@ class Deva {
352
376
 
353
377
  /**************
354
378
  func: Wall
355
- params: client: false
379
+ params: resolve, reject
356
380
  describe:
357
381
  The Defense feature sets the correct variables and necessary rules for the
358
382
  client presented data.
@@ -363,7 +387,7 @@ class Deva {
363
387
 
364
388
  /**************
365
389
  func: Shield
366
- params: client: false
390
+ params: resolve, reject
367
391
  describe:
368
392
  The Shield feature sets the correct variables and necessary rules for the
369
393
  client presented data.
@@ -374,7 +398,7 @@ class Deva {
374
398
 
375
399
  /**************
376
400
  func: Proxy
377
- params: client: false
401
+ params: resolve, reject
378
402
  describe:
379
403
  The Defense feature sets the correct variables and necessary rules for the
380
404
  client presented data.
@@ -385,7 +409,7 @@ class Deva {
385
409
 
386
410
  /**************
387
411
  func: Legal
388
- params: client: false
412
+ params: resolve, reject
389
413
  describe:
390
414
  The Legal feature sets the correct variables and necessary rules for the
391
415
  client presented data.
@@ -396,7 +420,7 @@ class Deva {
396
420
 
397
421
  /**************
398
422
  func: Justice
399
- params: client: false
423
+ params: resolve, reject
400
424
  describe:
401
425
  The Justice feature sets the correct variables and necessary rules for the
402
426
  client presented data.
@@ -407,7 +431,7 @@ class Deva {
407
431
 
408
432
  /**************
409
433
  func: Authority
410
- params: client: false
434
+ params: resolve, reject
411
435
  describe:
412
436
  The Authority feature sets the correct variables and necessary rules for the
413
437
  client presented data.
@@ -418,7 +442,7 @@ class Deva {
418
442
 
419
443
  /**************
420
444
  func: Support
421
- params: client: false
445
+ params: resolve, reject
422
446
  describe:
423
447
  The Support feature sets the correct variables and necessary rules for the
424
448
  client presented data.
@@ -429,7 +453,7 @@ class Deva {
429
453
 
430
454
  /**************
431
455
  func: Services
432
- params: client: false
456
+ params: resolve, reject
433
457
  describe:
434
458
  The Services feature sets the correct variables and necessary rules for the
435
459
  client presented data.
@@ -826,6 +850,10 @@ class Deva {
826
850
  return this.Client(client, resolve, reject);
827
851
  }).then(() => {
828
852
  return this.Vector(resolve, reject);
853
+ }).then(() => {
854
+ return this.Veda(resolve, reject);
855
+ }).then(() => {
856
+ return this.King(resolve, reject);
829
857
  }).then(() => {
830
858
  return this.Treasury(resolve, reject);
831
859
  }).then(() => {
@@ -897,15 +925,16 @@ class Deva {
897
925
  const hasOnStart = this.onStart && typeof this.onStart === 'function' ? true : false;
898
926
 
899
927
  this.state('start', data.id);
928
+ this.talk(config.events.start, data);
900
929
  return hasOnStart ? this.onStart(data, resolve) : this.enter(data, resolve)
901
930
  }
902
931
 
903
932
  /**************
904
933
  func: enter
905
934
  params:
906
- - msg: hte message from the caller incase need to use in calls
935
+ - msg: the message from the caller incase need to use in calls
907
936
  describe:
908
- The ener function will check the actie status of the Deva and set it to
937
+ The enter function will check the active status of the Deva and set it to
909
938
  offline or enter.
910
939
 
911
940
  If the Deva is offline it will return the offline message.
@@ -929,6 +958,7 @@ class Deva {
929
958
  data.sha512 = this.lib.hash(data, 'sha512');
930
959
 
931
960
  this.state('enter', data.id);
961
+ this.talk(config.events.enter, data);
932
962
  return hasOnEnter ? this.onEnter(data, resolve) : this.done(data, resolve)
933
963
  }
934
964
 
@@ -961,6 +991,7 @@ class Deva {
961
991
  data.sha512 = this.lib.hash(data, 'sha512');
962
992
 
963
993
  this.state('done', data.id);
994
+ this.talk(config.events.done, data);
964
995
  return hasOnDone ? this.onDone(data, resolve) : this.ready(data, resolve);
965
996
  }
966
997
 
@@ -990,6 +1021,7 @@ class Deva {
990
1021
  data.sha512 = this.lib.hash(data, 'sha512');
991
1022
 
992
1023
  this.state('ready', data.id);
1024
+ this.talk(config.events.ready, data);
993
1025
  return hasOnReady ? this.onReady(data, resolve) : resolve(data);
994
1026
  }
995
1027
 
@@ -1021,6 +1053,7 @@ class Deva {
1021
1053
  data.sha512 = this.lib.hash(data, 'sha512');
1022
1054
 
1023
1055
  this.state('finish', data.id); // set finish state
1056
+ this.talk(config.events.finish, data);
1024
1057
  return hasOnFinish ? this.onFinish(data, resolve) : this.complete(data, resolve);
1025
1058
  }
1026
1059
 
@@ -1050,6 +1083,7 @@ class Deva {
1050
1083
  data.sha512 = this.lib.hash(data, 'sha512');
1051
1084
 
1052
1085
  this.state('complete', data.id);
1086
+ this.talk(config.events.complete, data);
1053
1087
  return hasOnComplete ? this.onComplete(data, resolve) : resolve(data);
1054
1088
  }
1055
1089
 
@@ -1090,6 +1124,7 @@ class Deva {
1090
1124
  // has stop function then set hasOnStop variable
1091
1125
  // if: has on stop then run on stop function or return exit function.
1092
1126
  this.state('stop', id); // set the state to stop
1127
+ this.talk(config.events.stop, data);
1093
1128
  return hasOnStop ? this.onStop(data) : this.exit()
1094
1129
  }
1095
1130
 
@@ -1125,6 +1160,8 @@ class Deva {
1125
1160
  data.sha512 = this.lib.hash(data, 'sha512');
1126
1161
 
1127
1162
  this.state('exit', id); // set the state to stop
1163
+ this.talk(config.events.exit, data);
1164
+
1128
1165
  // clear memory
1129
1166
  this._active = false;
1130
1167
  this._client = false;
@@ -1492,6 +1529,26 @@ class Deva {
1492
1529
  }
1493
1530
 
1494
1531
  // FEATURE FUNCTIONS
1532
+ /**************
1533
+ func: veda
1534
+ params: none
1535
+ describe: basic veda features available in a Deva.
1536
+ usage: this.veda()
1537
+ ***************/
1538
+ veda() {
1539
+ return this._getFeature('veda', this._vector);
1540
+ }
1541
+
1542
+ /**************
1543
+ func: king
1544
+ params: none
1545
+ describe: basic king features available in a Deva.
1546
+ usage: this.king()
1547
+ ***************/
1548
+ king() {
1549
+ return this._getFeature('king', this._vector);
1550
+ }
1551
+
1495
1552
  /**************
1496
1553
  func: vector
1497
1554
  params: none
package/lib/index.js CHANGED
@@ -49,21 +49,23 @@ class LIB {
49
49
  The uid function can create two types of id for you.
50
50
  1. random GUID - this is good for when you need a uinique record id returned
51
51
  2. transport id - The transport id is a number generated to provide a
52
- numerical number used for transporting records to places
53
- like social networks, email, other networks where informaton
54
- is shared.
52
+ secure numerical number used for transporting records
53
+ across networks without collision or needing to store system uuid.
54
+ copyright: 2025 Quinn A Michaels. All rights reserved.
55
55
  ***************/
56
- uid(guid=false) {
57
- let id;
56
+ uid(guid=false) {
57
+ const time = Date.now();
58
58
  if (guid) {
59
- id = randomUUID()
59
+ const guid = randomUUID(); // set guid into local variable for testing.
60
+ return guid; // return the guid.
60
61
  }
61
62
  else {
62
- const min = `${Math.floor(Date.now() - (Date.now() / Math.PI))}00000`;
63
- const max = `${Math.ceil(Date.now() + (Date.now() * Math.PI))}99999`;
64
- id = Math.floor(Math.random() * (Number(max) - Number(min))) + Number(min);
63
+ const min = Math.floor(time - (time / Math.PI)); // generate min time from Math.PI divisor.
64
+ const max = Math.ceil(time + (time * Math.PI)); // generate max time form Math.PI multiplier.
65
+ 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.
65
68
  }
66
- return id;
67
69
  }
68
70
 
69
71
  /**************
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
+ "id": "9f0bc743-d720-4320-832e-cf5edc3b7cf",
2
3
  "name": "@indra.ai/deva",
3
- "version": "1.5.52",
4
+ "version": "1.5.54",
4
5
  "description": "The Deva Core",
5
6
  "main": "index.js",
6
7
  "copyright": "(c)2025 Quinn Michaels; All rights reserved.",
@@ -23,8 +24,8 @@
23
24
  "license": "Unlicense",
24
25
  "author": {
25
26
  "name": "Quinn Michaels",
26
- "email": "quinn@quinnmichaels.com",
27
- "url": "https://quinnmichaels.com/"
27
+ "email": "quinn@indra.ai",
28
+ "url": "https://indra.ai/"
28
29
  },
29
30
  "funding": [
30
31
  {
@@ -39,7 +40,7 @@
39
40
  "bugs": {
40
41
  "url": "https://github.com/indraai/deva/issues"
41
42
  },
42
- "homepage": "https://deva.world",
43
+ "homepage": "https://indra.ai",
43
44
  "eslintConfig": {
44
45
  "parserOptions": {
45
46
  "ecmaVersion": 6
@@ -67,6 +68,14 @@
67
68
  "events": {
68
69
  "prompt": "devacore:prompt",
69
70
  "error": "devacore:error",
71
+ "start": "devacore:start",
72
+ "enter": "devacore:enter",
73
+ "done": "devacore:done",
74
+ "ready": "devacore:ready",
75
+ "finish": "devacore:finish",
76
+ "complete": "devacore:complete",
77
+ "stop": "devacore:stop",
78
+ "exit": "devacore:exit",
70
79
  "question": "devacore:question",
71
80
  "answer": "devacore:answer",
72
81
  "ask": "devacore:ask",
@@ -89,7 +98,7 @@
89
98
  "init": "๐ŸŸ  Init",
90
99
  "start": "๐ŸŸข Start",
91
100
  "enter": "๐Ÿšช Enter",
92
- "done": "๐ŸŸฃ Done",
101
+ "done": "โ˜‘๏ธ Done",
93
102
  "ready": "โญ๏ธ Ready",
94
103
  "finish": "๐Ÿ Finish",
95
104
  "complete": "โœ… Complete",
@@ -99,19 +108,22 @@
99
108
  "agent": "๐Ÿค– Agent",
100
109
  "client": "๐Ÿ‘จ Client",
101
110
  "vector": "๐Ÿ›ค๏ธ Vector",
111
+ "veda": "๐Ÿ•‰๏ธ Veda",
112
+ "king": "๐Ÿ‘‘๏ธ King",
102
113
  "treasury": "๐Ÿฆ๏ธ Treasury",
103
- "security": "๐Ÿ” Security",
114
+ "security": "๐Ÿšจ Security",
104
115
  "guard": "๐Ÿ’‚ Guard",
105
116
  "wall": "๐Ÿงฑ Wall",
117
+ "shield": "๐Ÿ›ก๏ธ Shield",
106
118
  "defense": "๐Ÿช– Defense",
107
- "proxy": "๐Ÿ”— Proxy",
119
+ "proxy": "๐Ÿ‘พ๏ธ Proxy",
108
120
  "legal": "๐Ÿ›๏ธ Legal",
109
121
  "authority": "๐Ÿš” Authority",
110
122
  "justice": "โš–๏ธ Justice",
111
- "support": "๐Ÿš‘ Support",
112
- "services": "๐Ÿšš Services",
113
- "systems": "๐Ÿš› Systems",
114
- "networks": "๐Ÿ›ฐ๏ธ Networks",
123
+ "support": "๐Ÿ’ผ Support",
124
+ "services": "๐Ÿ› ๏ธ Services",
125
+ "systems": "๐Ÿ–ฅ๏ธ๏ธ Systems",
126
+ "networks": "๐Ÿ“ก Networks",
115
127
  "help": "๐Ÿ’š Help",
116
128
  "error": "โŒ Error!"
117
129
  },
@@ -138,7 +150,7 @@
138
150
  "init": "๐ŸŸ  Init",
139
151
  "start": "๐ŸŸข Start",
140
152
  "enter": "๐Ÿšช Enter",
141
- "done": "๐ŸŸฃ Done",
153
+ "done": "โ˜‘๏ธ Done",
142
154
  "ready": "โญ๏ธ Ready",
143
155
  "finish": "๐Ÿ Finish",
144
156
  "complete": "โœ… Complete",
@@ -172,7 +184,7 @@
172
184
  "help": "๐Ÿ’™ Help",
173
185
  "authorized": "๐Ÿ”‘ Authorized",
174
186
  "unauthorized": "๐Ÿดโ€โ˜ ๏ธ Unauthorized",
175
- "Done": "โ˜‘๏ธ Done",
187
+ "Done": "โ˜‘๏ธ Done",
176
188
  "glitch": "๐Ÿ˜ก Glitch",
177
189
  "intruder": "๐Ÿฆนโ€โ™‚๏ธ Intruder",
178
190
  "snooper": "๐Ÿ‘€ Snooper",
@@ -197,16 +209,23 @@
197
209
  "actions": {
198
210
  "client": "๐Ÿ‘จ Client",
199
211
  "agent": "๐Ÿ•ต๏ธโ€โ™‚๏ธ Agent",
200
- "security": "๐Ÿ” Security",
212
+ "vector": "๐Ÿ‘ฝ Vector",
213
+ "veda": "๐Ÿ•‰๏ธ Veda",
214
+ "king": "๐Ÿ‘‘๏ธ King",
215
+ "security": "๐Ÿšจ Security",
201
216
  "guard": "๐Ÿ’‚ Guard",
217
+ "shield": "๐Ÿ›ก๏ธ Shield",
218
+ "wall": "๐Ÿงฑ Wall",
219
+ "proxy": "๐Ÿ‘พ๏ธ Proxy",
202
220
  "defense": "๐Ÿช– Defense",
203
- "support": "๐Ÿฉน Support",
221
+ "support": "๐Ÿ’ผ Support",
204
222
  "services": "๐Ÿ› ๏ธ Services",
205
223
  "systems": "๐Ÿ–ฅ๏ธ Systems",
206
224
  "networks": "๐Ÿ“ก Networks",
207
- "legal": "๐Ÿ—ƒ๏ธ Legal",
208
- "justice": "๐Ÿ—„๏ธ Justice",
209
- "authority": "๐Ÿ‘ฎ Authority",
225
+ "legal": "๐Ÿ›๏ธ Legal",
226
+ "justice": "โš–๏ธ Justice",
227
+ "authority": "๐Ÿš” Authority",
228
+ "treasury": "๐Ÿฆ Treasury",
210
229
  "talk": "๐Ÿ“ข Talk",
211
230
  "listen": "๐Ÿ‘‚ Listen",
212
231
  "once": "๐Ÿ‘‚ Once",
@@ -234,7 +253,7 @@
234
253
  "status": "๐Ÿšฅ Status",
235
254
  "error": "๐Ÿ’ฃ Error",
236
255
  "help": "๐Ÿ’œ Help",
237
- "done": "๐ŸŸฃ Done",
256
+ "done": "โ˜‘๏ธ Done",
238
257
  "ready": "โญ๏ธ Ready",
239
258
  "complete": "โœ… Complete"
240
259
  },
@@ -244,27 +263,29 @@
244
263
  "agent": "๐Ÿฆพ Agent",
245
264
  "client": "๐Ÿ’ช Client",
246
265
  "vector": "๐Ÿ›ค๏ธ Vector",
247
- "treasury": "๐Ÿช™๏ธ Treasury",
248
- "security": "๐Ÿ” Security",
266
+ "veda": "๐Ÿ•‰๏ธ Veda",
267
+ "king": "๐Ÿ‘‘๏ธ King",
268
+ "treasury": "๐Ÿฆ Treasury",
269
+ "security": "๐Ÿšจ Security",
249
270
  "guard": "๐Ÿ’‚ Guard",
250
271
  "defense": "๐Ÿช–๏ธ๏ธ Defense",
251
272
  "wall": "๐Ÿงฑ Wall",
252
273
  "shield": "๐Ÿ›ก๏ธ Shield",
253
- "proxy": "๐Ÿค Proxy",
254
- "legal": "๐Ÿ—‚๏ธ๏ธ๏ธ Legal",
255
- "authority": "๐Ÿš“๏ธ๏ธ Authority",
256
- "justice": "๐Ÿ›๏ธ๏ธ Justice",
274
+ "proxy": "๐Ÿ‘พ๏ธ Proxy",
275
+ "legal": "๐Ÿ›๏ธ Legal",
276
+ "authority": "๐Ÿš” Authority",
277
+ "justice": "โš–๏ธ Justice",
257
278
  "support": "๐Ÿ’ผ Support",
258
279
  "services": "๐Ÿ› ๏ธ Services",
259
280
  "systems": "๐Ÿ–ฅ๏ธ๏ธ Systems",
260
- "networks": "๐Ÿ›œ๏ธ๏ธ Networks"
281
+ "networks": "๐Ÿ“ก Networks"
261
282
  },
262
283
  "message": "offline",
263
284
  "messages": {
264
285
  "init": "๐ŸŸ  INIT",
265
286
  "start": "๐ŸŸข START",
266
287
  "enter": "๐Ÿ”ต ENTER",
267
- "done": "๐ŸŸฃ DONE",
288
+ "done": "โ˜‘๏ธ DONE",
268
289
  "ready": "โญ๏ธ READY",
269
290
  "stop": "๐Ÿ”ด STOP",
270
291
  "exit": "๐Ÿšช EXIT",
package/tests/agent.json CHANGED
@@ -30,6 +30,12 @@
30
30
  "gender": "M"
31
31
  },
32
32
  "features": {
33
+ "vector": {
34
+ "label": "๐Ÿ›ค๏ธVECTOR",
35
+ "name": "@VECTOR",
36
+ "tag": "#VECTOR",
37
+ "loc": "$VECTOR"
38
+ },
33
39
  "security": {
34
40
  "label": "๐ŸšจSECURITY",
35
41
  "name": "@SECURITY",
@@ -88,11 +94,16 @@
88
94
  "vars": {
89
95
  "hello": "Hellow World",
90
96
  "context": {
91
- "ready": "๐Ÿค Everything is ready!",
97
+ "start": "๐ŸŽ๏ธ Start",
98
+ "enter": "๐Ÿšช๏ธ Enter",
99
+ "done": "โœ… Done",
100
+ "ready": "๐Ÿ‘ Ready",
101
+ "finish": "๐Ÿ Finish",
102
+ "complete": "๐Ÿค Complete",
92
103
  "test": "๐Ÿ’ฟ Test Data",
93
104
  "prompt": "๐Ÿ’ป Prompt",
94
- "feature": "๐Ÿฟ Accessing Feature",
95
- "zone": "๐Ÿ—ป Accessing Zone"
105
+ "feature": "๐Ÿฟ Feature",
106
+ "zone": "๐Ÿ—ป Zone"
96
107
  }
97
108
  }
98
109
  }
package/tests/client.json CHANGED
@@ -34,6 +34,16 @@
34
34
  "currency": "USD"
35
35
  },
36
36
  "features": {
37
+ "veda": {
38
+ "concerns": [],
39
+ "global": [],
40
+ "devas": {}
41
+ },
42
+ "king": {
43
+ "concerns": [],
44
+ "global": [],
45
+ "devas": {}
46
+ },
37
47
  "vector": {
38
48
  "concerns": [],
39
49
  "global": [],
package/tests/index.js CHANGED
@@ -8,23 +8,25 @@ import Agent from './agent.json' with {type:'json'};
8
8
  const agent = Agent.DATA;
9
9
 
10
10
  import Deva from '../index.js';
11
+ import pkg from '../package.json' with {type:'json'};
11
12
 
12
13
  import {dirname} from 'node:path';
13
14
  import {fileURLToPath} from 'node:url';
14
15
  const __dirname = dirname(fileURLToPath(import.meta.url));
15
16
 
16
17
  const info = {
17
- id: '00000',
18
- name: 'Deva Core Test',
19
- describe: 'Deva Core Test Package',
20
- version: '0.0.0',
18
+ id: pkg.id,
19
+ name: pkg.name,
20
+ describe: pkg.description,
21
+ version: pkg.version,
22
+ author: pkg.author.name,
23
+ email: pkg.author.email,
24
+ url: pkg.authorurl,
25
+ copyright: pkg.copyright,
21
26
  dir: __dirname,
22
- url: 'https://deva.world/test',
23
- git: 'git+https://github.com/indraai/deva.git',
24
- bugs: 'git+https://github.com/indraai/deva.git#bugs',
25
- author: 'Quinn Michaels',
27
+ git: pkg.repository.url,
28
+ bugs: pkg.bugs.url,
26
29
  license: 'TESTING ONLY',
27
- copyright: 2025,
28
30
  };
29
31
 
30
32
  const DevaTest = new Deva({
@@ -55,6 +57,24 @@ const DevaTest = new Deva({
55
57
  'devacore:question'(packet) {
56
58
  console.log(`๐Ÿ™‹โ€โ™‚๏ธ๏ธ question: ${packet.text}`);
57
59
  },
60
+ 'devacore:start'(packet) {
61
+ console.log(`๐ŸŸข start: ${packet.text}`);
62
+ },
63
+ 'devacore:enter'(packet) {
64
+ console.log(`๐Ÿšช enter: ${packet.text}`);
65
+ },
66
+ 'devacore:done'(packet) {
67
+ console.log(`โ˜‘๏ธ done: ${packet.text}`);
68
+ },
69
+ 'devacore:ready'(packet) {
70
+ console.log(`โญ๏ธ ready: ${packet.text}`);
71
+ },
72
+ 'devacore:finish'(packet) {
73
+ console.log(`๐Ÿ finish: ${packet.text}`);
74
+ },
75
+ 'devacore:complete'(packet) {
76
+ console.log(`โœ… complete: ${packet.text}`);
77
+ },
58
78
  'devacore:answer'(packet) {
59
79
  console.log(`๐Ÿ‘จโ€๐Ÿ”ฌ answer: ${packet.text}`);
60
80
  },
@@ -71,12 +91,11 @@ const DevaTest = new Deva({
71
91
  console.log(`๐Ÿ’ฅ action: ${packet.text}`);
72
92
  },
73
93
  'devacore:feature'(packet) {
74
- console.log(`---`);
75
94
  this.context('feature');
76
95
  console.log(`๐Ÿฟ feature: ${packet.text}`);
77
96
  },
78
97
  'devacore:context'(packet) {
79
- console.log(`๐Ÿ›น context: ${packet.text}`);
98
+ console.log(`\n๐Ÿ›น context: ${packet.text}`);
80
99
  },
81
100
  'devacore:error'(packet) {
82
101
  console.log(`โŒ error: ${packet.text}`);
@@ -87,13 +106,8 @@ const DevaTest = new Deva({
87
106
  func: {
88
107
  test(packet) {
89
108
  const text = this._state
90
- const id = this.lib.uid();
91
- const uid = this.lib.uid(true);
92
109
  const core = this.core();
93
110
  const info = this.info();
94
- const date = Date.now();
95
- const hashstr = `${id}${uid}${date}`;
96
- const proxy = this.proxy(hashstr);
97
111
  const data = [
98
112
  '๐Ÿงช TEST RESULTS',
99
113
  `::BEGIN:CORE:${core.id}`,
@@ -115,9 +129,32 @@ const DevaTest = new Deva({
115
129
  return this.func.test(packet);
116
130
  }
117
131
  },
132
+ onStart(data, resolve) {
133
+ this.context('start', data.id);
134
+ return this.enter(data, resolve);
135
+ },
136
+ onEnter(data, resolve) {
137
+ this.context('enter', data.id);
138
+ return this.done(data, resolve);
139
+ },
140
+ onDone(data, resolve) {
141
+ this.context('done', data.id);
142
+ return this.ready(data, resolve);
143
+ },
118
144
  onReady(data, resolve) {
119
- this.context('ready');
120
- this.prompt(this.methods.test(data).text);
145
+ this.context('ready', data.id);
146
+ const test = this.methods.test(data);
147
+ this.prompt(test.text);
148
+ setTimeout(() => {
149
+ return resolve(data);
150
+ }, 10000);
151
+ },
152
+ onFinish(data, resolve) {
153
+ this.context('finish', data.id);
154
+ return this.complete(data, resolve);
155
+ },
156
+ onComplete(data, resolve) {
157
+ this.context('complete', data.id);
121
158
  return resolve(data);
122
159
  },
123
160
  onError(e) {