Skip to content

Commit

Permalink
update core deva
Browse files Browse the repository at this point in the history
  • Loading branch information
indraai committed Sep 1, 2023
1 parent d4eb4cb commit 7eaaa47
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 29 deletions.
23 changes: 12 additions & 11 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,25 @@
"deva": "#Deva",
"client": "#Client",
"agent": "#Agent",
"question": "#Question",
"answer": "#Answer",
"ask": "#Ask",
"security": "#Security",
"support": "#Support",
"services": "#Services",
"systems": "#Systems",
"done": "#Done",
"config": "#Config",
"school": "#School",
"work": "#Work",
"legal": "#Legal",
"business": "#Business",
"art": "#Art",
"music": "#Music",
"fun": "#Fun",
"adventure": "#Adventure",
"party": "#Party",
"adventure": "#Adventure",
"cartoon": "#Cartoon",
"mystery": "#Mystery",
"fantasy": "#Fantasy",
"romance": "#Romance",
"comedy": "#Comedy",
"drama": "#Drama",
"scifi": "#SciFi",
"finish": "#Finish",
"init": "#Init",
"start": "#Start",
"stop": "#Stop",
"help": "#Help",
"error": "#Error"
},
Expand Down
18 changes: 0 additions & 18 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,11 @@ class Deva {
describe: The end of the workflow Client Feature Workflow
***************/
Done(client) {
this.zone('done'); // set state to assistant setting
this.state('done');
this.action('done');
return new Promise((resolve, reject) => {
try {
delete this._client.features; // delete the features key when done.
this.zone('deva'); // put the agent back in the deva zone.
this.state('ready');
this.action('wait');
return resolve(client); // resolve an empty pr
Expand Down Expand Up @@ -443,7 +441,6 @@ class Deva {
describe:
***************/
question(TEXT=false, DATA=false) {
this.zone('question');
// check the active status
if (!this._active) return Promise.resolve(this._messages.offline);

Expand Down Expand Up @@ -546,7 +543,6 @@ class Deva {
from the agent from the pre-determined method.
***************/
answer(packet, resolve, reject) {
this.zone('answer');
if (!this._active) return Promise.resolve(this._messages.offline);
this.state('answer');
// check if method exists and is of type function
Expand Down Expand Up @@ -610,7 +606,6 @@ class Deva {
so the event is specific to the talk.
***************/
ask(packet) {
this.zone('ask');
if (!this._active) return Promise.resolve(this._messages.offline);

this.state('ask');
Expand Down Expand Up @@ -687,7 +682,6 @@ class Deva {
usage: this.init(client_object)
***************/
init(client) {
this.zone('init');
// set client
this._active = Date.now();
const agent = this.agent();
Expand Down Expand Up @@ -733,7 +727,6 @@ class Deva {
usage: this.start('msg')
***************/
start(data) {
this.zone('start');
if (!this._active) return Promise.resolve(this._messages.offline);
this.state('start');
data.value = 'start';
Expand All @@ -756,7 +749,6 @@ class Deva {
usage: this.enter('msg')
***************/
enter(data) {
this.zone('enter');
if (!this._active) return Promise.resolve(this._messages.offline);
this.state('enter');
data.value = 'enter';
Expand All @@ -779,7 +771,6 @@ class Deva {
usage: this.done('msg')
***************/
done(data) {
this.zone('done');
if (!this._active) return Promise.resolve(this._messages.offline);
this.state('done');
data.value = 'done';
Expand All @@ -802,7 +793,6 @@ class Deva {
this.finish(data, resolve)
***************/
finish(packet, resolve) {
this.zone('finish');
if (!this._active) return Promise.resolve(this._messages.offline);
this.state('finish');
packet.hash = this.hash(packet);// hash the entire packet before finishing.
Expand All @@ -827,7 +817,6 @@ class Deva {
this.stop('msg')
***************/
stop() {
this.zone('stop');
if (!this._active) return Promise.resolve(this._messages.offline);

this.state('stop');
Expand Down Expand Up @@ -867,7 +856,6 @@ class Deva {
usage: this.exit('msg')
***************/
exit(data) {
this.zone('exit');
this._active = false;
data.value = 'exit';
delete data.hash;
Expand Down Expand Up @@ -1120,7 +1108,6 @@ class Deva {
***************/
security() {
this.feature('security'); // set the security state
this.zone('security');
if (!this._active) return this._messages.offline; // check the active status
this.state('data'); // set the security state
try {
Expand All @@ -1137,7 +1124,6 @@ class Deva {
***************/
support() {
this.feature('support'); // set the support state
this.zone('support'); // set the support state
if (!this._active) return this._messages.offline; // check the active status
this.state('data');
try {
Expand All @@ -1154,7 +1140,6 @@ class Deva {
***************/
services(opts) {
this.feature('services'); // set the support state
this.zone('services'); // set the support state
if (!this._active) return this._messages.offline; // check the active status
this.state('data'); // set the services state
try {
Expand All @@ -1171,7 +1156,6 @@ class Deva {
***************/
systems(opts) {
this.feature('systems'); // set the systems state
this.zone('systems'); // set the systems state
if (!this._active) return this._messages.offline; // check the active status
this.state('data');
try {
Expand Down Expand Up @@ -1461,7 +1445,6 @@ class Deva {
describe: return info data.
***************/
info() {
this.zone('support');
// check the active status
if (!this._active) return Promise.resolve(this._messages.offline);
this.action('info');
Expand All @@ -1480,7 +1463,6 @@ class Deva {
usage: this.status('msg')
***************/
status(msg=false) {
this.zone('support');
// check the active status
if (!this._active) return Promise.resolve(this._messages.states.offline);
// format the date since active for output.
Expand Down

0 comments on commit 7eaaa47

Please sign in to comment.