@indra.ai/deva 1.4.24 → 1.4.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 +16 -11
  2. package/package.json +2 -1
package/index.js CHANGED
@@ -1486,23 +1486,28 @@ class Deva {
1486
1486
  help(msg, help_dir) {
1487
1487
  return new Promise((resolve, reject) => {
1488
1488
  if (!this._active) return resolve(this._messages.offline);
1489
- this.zone('help');
1490
- this.feature('help');
1491
- this.action('help');
1492
- this.state('help');
1493
- this.context('help');
1494
-
1495
1489
  const params = msg.split(' ');
1496
1490
  let helpFile = 'main';
1497
1491
  if (params[0]) helpFile = params[0];
1498
1492
  if (params[1]) helpFile = `${params[0]}_${params[1]}`;
1499
- helpFile = this.lib.path.join(help_dir, 'help', `${helpFile}.feecting`);
1493
+
1494
+ this.context('help', helpFile);
1495
+ this.zone('help', helpFile);
1496
+ this.feature('help', helpFile);
1497
+ this.action('help', helpFile);
1498
+ this.state('help', helpFile);
1499
+
1500
+ const helpPath = this.lib.path.join(help_dir, 'help', `${helpFile}.feecting`);
1501
+ this.state('try', `help:${helpFile}`);
1500
1502
  try {
1501
- this.state('resolve', 'help');
1502
- return resolve(this.lib.fs.readFileSync(helpFile, 'utf8'));
1503
+ const helpExists = fs.existsSync(helpPath);
1504
+ if (!helpExists) return resolve(this._messages.help_not_found);
1505
+ const helpDoc = this.lib.fs.readFileSync(helpPath, 'utf8');
1506
+ this.state('finish', `help:${helpFile}`);
1507
+ return this.finish(helpDoc, resolve);
1503
1508
  } catch (e) {
1504
- this.state('reject', 'help');
1505
- return reject(e)
1509
+ this.state('catch', `help:${helpFile}`);
1510
+ return this.error(e, msg, reject);
1506
1511
  }
1507
1512
  });
1508
1513
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indra.ai/deva",
3
- "version": "1.4.24",
3
+ "version": "1.4.26",
4
4
  "description": "The Deva Core",
5
5
  "main": "index.js",
6
6
  "copyright": "(c)2025 Quinn Michaels; All rights reserved.",
@@ -280,6 +280,7 @@
280
280
  "notext": "NO TEXT WAS PROVIDED",
281
281
  "nopacket": "NO PACKET WAS PROVIDED",
282
282
  "method_not_found": "METHOD NOT FOUND",
283
+ "help_not_found": "🚫 HELP NOT FOUND",
283
284
  "stop": "Stop Deva.",
284
285
  "exit": "Exit Deva"
285
286
  }