@indra.ai/deva 1.1.124 → 1.1.126

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 +10 -10
  2. package/index.js +18 -15
  3. package/package.json +1 -1
package/config.json CHANGED
@@ -212,16 +212,16 @@
212
212
  "contexts": "listing the contexts"
213
213
  },
214
214
  "features": {
215
- "security": "accessing #security feature",
216
- "support": "accessing #support feature",
217
- "services": "accessing #services feature",
218
- "solutions": "solutions feature",
219
- "systems": "systems feature",
220
- "research": "research feature",
221
- "development": "development feature",
222
- "business": "business feature",
223
- "legal": "legal feature",
224
- "assistant": "assistant feature"
215
+ "security": "access #security",
216
+ "support": "access #support",
217
+ "services": "access #services",
218
+ "solutions": "access #solutions",
219
+ "systems": "access #systems",
220
+ "research": "access #research",
221
+ "development": "access #development",
222
+ "business": "access #business",
223
+ "legal": "access #legal",
224
+ "assistant": "access #assistant"
225
225
  }
226
226
  }
227
227
  }
package/index.js CHANGED
@@ -1140,22 +1140,25 @@ class Deva {
1140
1140
  ***************/
1141
1141
  action(action) {
1142
1142
  try {
1143
- if (!this._actions[action]) return;
1144
- this._action = action;
1145
- const text = this._messages.actions[action];
1146
- const data = {
1147
- id: this.uid(true),
1148
- key: 'action',
1149
- value: action,
1150
- agent: this.agent(),
1151
- client: this.client(),
1152
- text,
1153
- created: Date.now(),
1143
+ this._action = action; // set the local action variable
1144
+ // check local vars for custom actions
1145
+ const var_action = this.vars.actions ? this.vars.actions[action] : false;
1146
+ // check system action messages
1147
+ const msg_action = this._messages.actions[action] || var_action;
1148
+ const text = msg_action || action; // set the text of the action
1149
+ const data = { // build the data object for the action.
1150
+ id: this.uid(true), // generate a guid for the action transmitssion.
1151
+ key: 'action', // the key for event to transmit action type
1152
+ value: action, // the value key which is the action passed
1153
+ agent: this.agent(), // the agent data to send with the action
1154
+ client: this.client(), // the client data to send with the action
1155
+ text, // text of the action to send
1156
+ created: Date.now(), // action time stamp
1154
1157
  };
1155
- data.hash = this.hash(data);
1156
- this.talk(config.events.action, data);
1157
- } catch (e) {
1158
- return this.error(e)
1158
+ data.hash = this.hash(data); // generate a hash of the action packet.
1159
+ this.talk(config.events.action, data); // talk the core action event
1160
+ } catch (e) { // catch any errors that occur
1161
+ return this.error(e); // return error on error catch
1159
1162
  }
1160
1163
  }
1161
1164
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indra.ai/deva",
3
- "version": "1.1.124",
3
+ "version": "1.1.126",
4
4
  "description": "The Deva Core",
5
5
  "main": "index.js",
6
6
  "scripts": {