@indra.ai/deva 1.1.110 → 1.1.112

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 (3) hide show
  1. package/config.json +2 -2
  2. package/index.js +10 -10
  3. package/package.json +1 -1
package/config.json CHANGED
@@ -9,9 +9,9 @@
9
9
  "bind": [
10
10
  "listeners",
11
11
  "methods",
12
+ "utils",
12
13
  "func",
13
- "lib",
14
- "_agent"
14
+ "lib"
15
15
  ],
16
16
  "events": {
17
17
  "prompt": "devacore:prompt",
package/index.js CHANGED
@@ -29,6 +29,7 @@ class Deva {
29
29
  this._artist = false; // inherited artist features.
30
30
  this.events = opts.events || new EventEmitter({}); // Event Bus
31
31
  this.lib = opts.lib || {}; // used for loading library functions
32
+ this.utils = opts.util || {}; // parse function
32
33
  this.devas = opts.devas || {}; // Devas which are loaded
33
34
  this.vars = opts.vars || {}; // Variables object
34
35
  this.listeners = opts.listeners || {}; // local Listeners
@@ -95,15 +96,6 @@ class Deva {
95
96
  }
96
97
  }
97
98
  });
98
- // bind translate
99
- const translate = this._agent && this._agent.translate && typeof this._agent.translate === 'function';
100
- if (translate) this._agent.translate = this._agent.translate.bind(this);
101
- // bind parser
102
- const parse = this._agent && this._agent.parse && typeof this._agent.parse === 'function';
103
- if (parse) this._agent.parse = this._agent.parse.bind(this);
104
- // bind process
105
- const process = this._agent && this._agent.process && typeof this._agent.process === 'function';
106
- if (process) this._agent.process = this._agent.process.bind(this);
107
99
  }
108
100
  catch (e) {
109
101
  return this.error(e, false, reject); // trigger the this.error for errors
@@ -308,6 +300,14 @@ class Deva {
308
300
  global: services.global, // the global policies for client
309
301
  personal: services.devas[this._agent.key], // Client personal features and rules.
310
302
  };
303
+
304
+ // setup any global methods from the services feature
305
+ for (const x in this._services.global) {
306
+ console.log('SETTING UP GLOBA SERVICE FUNCTIONS', x);
307
+ const isFunc = typeof this._services.global[x] === 'function' ? true :false;
308
+ if (isFunc) this.methods[x] = this._services.global[x].bind(this);
309
+ }
310
+
311
311
  delete this._client.features.services // delete the services key for isolation
312
312
  return this.Systems() // go to Systems when done
313
313
  }
@@ -512,7 +512,7 @@ class Deva {
512
512
  Assistant() {
513
513
  const _cl = this.client(); // set the client into a local variable
514
514
  try {
515
- if (!_cl.features.assistant) return this.Artis(); // if no Assistant then goto Done
515
+ if (!_cl.features.assistant) return this.Artist(); // if no Assistant then goto Done
516
516
  else {
517
517
  this.action('Assistant'); // set action to Assistant
518
518
  const {id, features, profile} = _cl; // set the local consts from client copy
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indra.ai/deva",
3
- "version": "1.1.110",
3
+ "version": "1.1.112",
4
4
  "description": "The Deva Core",
5
5
  "main": "index.js",
6
6
  "scripts": {