@indra.ai/deva 1.5.25 → 1.5.26

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.
Files changed (2) hide show
  1. package/index.js +9 -3
  2. package/package.json +5 -4
package/index.js CHANGED
@@ -791,6 +791,7 @@ class Deva {
791
791
  packet.hash = this.lib.hash(packet);
792
792
  const hasOnStart = this.onStart && typeof this.onStart === 'function' ? true : false;
793
793
  this.state('start');
794
+ this.prompt(this._messages.start);
794
795
  return hasOnStart ? this.onStart(packet, resolve) : this.enter(packet, resolve)
795
796
  }
796
797
 
@@ -814,6 +815,7 @@ class Deva {
814
815
  delete packet.hash;
815
816
  packet.value = 'enter';
816
817
  packet.hash = this.lib.hash(packet);
818
+ this.prompt(this._messages.enter);
817
819
  return hasOnEnter ? this.onEnter(packet, resolve) : this.done(packet, resolve)
818
820
  }
819
821
 
@@ -837,6 +839,7 @@ class Deva {
837
839
  packet.value = 'done';
838
840
  delete packet.hash;
839
841
  packet.hash = this.lib.hash(packet);
842
+ this.prompt(this._messages.done);
840
843
  return hasOnDone ? this.onDone(packet, resolve) : this.ready(packet, resolve);
841
844
  }
842
845
 
@@ -857,6 +860,7 @@ class Deva {
857
860
  packet.value = 'ready';
858
861
  delete packet.hash;
859
862
  packet.hash = this.lib.hash(packet);// hash the entire packet before completeing.
863
+ this.prompt(this._messages.ready);
860
864
  return hasOnReady ? this.onReady(packet, resolve) : resolve(packet);
861
865
  }
862
866
 
@@ -932,6 +936,7 @@ class Deva {
932
936
  data.hash = this.lib.hash(data);
933
937
  // has stop function then set hasOnStop variable
934
938
  // if: has on stop then run on stop function or return exit function.
939
+ this.prompt(this._messages.stop);
935
940
  return hasOnStop ? this.onStop(data) : this.exit()
936
941
  }
937
942
 
@@ -952,7 +957,6 @@ class Deva {
952
957
  const hasOnExit = this.onExit && typeof this.onExit === 'function';
953
958
  this.zone('exit', id);
954
959
  this.action('exit', id);
955
- this.state('exit', id); // set the state to stop
956
960
 
957
961
  const data = {
958
962
  id,
@@ -964,6 +968,8 @@ class Deva {
964
968
  }
965
969
  data.hash = this.lib.hash(data);
966
970
 
971
+ this.state('exit', id); // set the state to stop
972
+ this.prompt(this._messages.exit);
967
973
  // clear memory
968
974
  this._active = false;
969
975
  this._client = false;
@@ -1391,7 +1397,7 @@ class Deva {
1391
1397
  describe: Unload a currently loaded Deva.
1392
1398
  ***************/
1393
1399
  unload(key) {
1394
- this.zone('deva', key);
1400
+ this.zone('unload', key);
1395
1401
  return new Promise((resolve, reject) => {
1396
1402
  try {
1397
1403
  this.action('uload', key);
@@ -1400,7 +1406,7 @@ class Deva {
1400
1406
  this.talk(config.events.unload, key);
1401
1407
  });
1402
1408
  this.state('unload', key)
1403
- return resolve(this._states.unload);
1409
+ return resolve(`${this._states.unload}:${key}`);
1404
1410
  } catch (e) {
1405
1411
  return this.error(e, this.devas[key], reject)
1406
1412
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indra.ai/deva",
3
- "version": "1.5.25",
3
+ "version": "1.5.26",
4
4
  "description": "The Deva Core",
5
5
  "main": "index.js",
6
6
  "copyright": "(c)2025 Quinn Michaels; All rights reserved.",
@@ -251,11 +251,12 @@
251
251
  "message": "offline",
252
252
  "messages": {
253
253
  "init": "🟠 INIT",
254
- "start": "🟢 START",
254
+ "start": "🟢 START",
255
255
  "enter": "🔵 ENTER",
256
+ "done": "🟣 DONE",
257
+ "ready": "⭐️ READY",
256
258
  "stop": "🔴 STOP",
257
- "exit": "🟡 EXIT",
258
- "done": "🟣 DONE",
259
+ "exit": "🚪 EXIT",
259
260
  "offline": "⭕️ OFFLINE",
260
261
  "noid": "⛔️ NO ID PROVIDED",
261
262
  "notext": "⛔️ NO TEXT PROVIDED",