botium-core 1.13.9 → 1.13.11
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.
- package/dist/botium-cjs.js +16 -10
- package/dist/botium-cjs.js.map +1 -1
- package/dist/botium-es.js +37 -31
- package/dist/botium-es.js.map +1 -1
- package/package.json +1 -1
- package/src/scripting/ScriptingProvider.js +2 -2
- package/src/scripting/helper.js +6 -2
package/dist/botium-cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ var randomatic = require('randomatic');
|
|
|
14
14
|
var lodash = require('lodash');
|
|
15
15
|
var boolean$1 = require('boolean');
|
|
16
16
|
var events = require('events');
|
|
17
|
-
var debug$
|
|
17
|
+
var debug$n = require('debug');
|
|
18
18
|
var vm2 = require('vm2');
|
|
19
19
|
var isClass = require('is-class');
|
|
20
20
|
var crypto = require('crypto');
|
|
@@ -54,7 +54,7 @@ var randomatic__default = /*#__PURE__*/_interopDefaultLegacy(randomatic);
|
|
|
54
54
|
var lodash__default = /*#__PURE__*/_interopDefaultLegacy(lodash);
|
|
55
55
|
var boolean__default = /*#__PURE__*/_interopDefaultLegacy(boolean$1);
|
|
56
56
|
var events__default = /*#__PURE__*/_interopDefaultLegacy(events);
|
|
57
|
-
var debug__default = /*#__PURE__*/_interopDefaultLegacy(debug$
|
|
57
|
+
var debug__default = /*#__PURE__*/_interopDefaultLegacy(debug$n);
|
|
58
58
|
var vm2__default = /*#__PURE__*/_interopDefaultLegacy(vm2);
|
|
59
59
|
var isClass__default = /*#__PURE__*/_interopDefaultLegacy(isClass);
|
|
60
60
|
var crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto);
|
|
@@ -81,7 +81,7 @@ var express__default = /*#__PURE__*/_interopDefaultLegacy(express);
|
|
|
81
81
|
var bodyParser__default = /*#__PURE__*/_interopDefaultLegacy(bodyParser);
|
|
82
82
|
|
|
83
83
|
var name = "botium-core";
|
|
84
|
-
var version$1 = "1.13.
|
|
84
|
+
var version$1 = "1.13.11";
|
|
85
85
|
var description = "The Selenium for Chatbots";
|
|
86
86
|
var main = "index.js";
|
|
87
87
|
var module$1 = "dist/botium-es.js";
|
|
@@ -1203,7 +1203,7 @@ LogicHookConsts.DEFAULT_USER_INPUTS;
|
|
|
1203
1203
|
const {
|
|
1204
1204
|
NodeVM: NodeVM$2
|
|
1205
1205
|
} = vm2__default["default"];
|
|
1206
|
-
const debug$
|
|
1206
|
+
const debug$m = debug__default["default"]('botium-core-asserterUtils');
|
|
1207
1207
|
const {
|
|
1208
1208
|
BotiumError: BotiumError$6
|
|
1209
1209
|
} = BotiumError_1;
|
|
@@ -1258,7 +1258,7 @@ var LogicHookUtils_1 = class LogicHookUtils {
|
|
|
1258
1258
|
_fetchAsserters() {
|
|
1259
1259
|
this.caps[Capabilities.ASSERTERS].forEach(asserter => {
|
|
1260
1260
|
if (this.asserters[asserter.ref]) {
|
|
1261
|
-
debug$
|
|
1261
|
+
debug$m(`${asserter.ref} asserter already exists, overwriting.`);
|
|
1262
1262
|
}
|
|
1263
1263
|
this.asserters[asserter.ref] = this._loadClass(asserter, 'asserter');
|
|
1264
1264
|
if (asserter.global) {
|
|
@@ -1269,7 +1269,7 @@ var LogicHookUtils_1 = class LogicHookUtils {
|
|
|
1269
1269
|
_fetchLogicHooks() {
|
|
1270
1270
|
this.caps[Capabilities.LOGIC_HOOKS].forEach(logicHook => {
|
|
1271
1271
|
if (this.logicHooks[logicHook.ref]) {
|
|
1272
|
-
debug$
|
|
1272
|
+
debug$m(`${logicHook.ref} logic hook already exists, overwriting.`);
|
|
1273
1273
|
}
|
|
1274
1274
|
this.logicHooks[logicHook.ref] = this._loadClass(logicHook, 'logichook');
|
|
1275
1275
|
if (logicHook.global) {
|
|
@@ -1280,7 +1280,7 @@ var LogicHookUtils_1 = class LogicHookUtils {
|
|
|
1280
1280
|
_fetchUserInputs() {
|
|
1281
1281
|
this.caps[Capabilities.USER_INPUTS].forEach(userInput => {
|
|
1282
1282
|
if (this.userInputs[userInput.ref]) {
|
|
1283
|
-
debug$
|
|
1283
|
+
debug$m(`${userInput.ref} userinput already exists, overwriting.`);
|
|
1284
1284
|
}
|
|
1285
1285
|
this.userInputs[userInput.ref] = this._loadClass(userInput, 'userinput');
|
|
1286
1286
|
});
|
|
@@ -1485,7 +1485,7 @@ var LogicHookUtils_1 = class LogicHookUtils {
|
|
|
1485
1485
|
loadErr.push(`Failed to fetch ${ref} ${hookType} from ${src} - ${err.message} `);
|
|
1486
1486
|
}
|
|
1487
1487
|
}
|
|
1488
|
-
loadErr.forEach(debug$
|
|
1488
|
+
loadErr.forEach(debug$m);
|
|
1489
1489
|
}
|
|
1490
1490
|
throw new Error(`Failed to fetch ${ref} ${hookType}, no idea how to load ...`);
|
|
1491
1491
|
}
|
|
@@ -1696,6 +1696,7 @@ var Enums = {
|
|
|
1696
1696
|
};
|
|
1697
1697
|
Enums.E_SCRIPTING_MEMORY_COLUMN_MODE;
|
|
1698
1698
|
|
|
1699
|
+
const debug$l = debug__default["default"]('botium-core-scripting-helper');
|
|
1699
1700
|
const {
|
|
1700
1701
|
E_SCRIPTING_MEMORY_COLUMN_MODE: E_SCRIPTING_MEMORY_COLUMN_MODE$1
|
|
1701
1702
|
} = Enums;
|
|
@@ -2246,7 +2247,7 @@ const calculateWer$1 = (str, pattern) => {
|
|
|
2246
2247
|
continue;
|
|
2247
2248
|
}
|
|
2248
2249
|
const wordCount = wildcardPart.split(' ').length;
|
|
2249
|
-
const subsetPhrases = _getSubsets(botMessageWords,
|
|
2250
|
+
const subsetPhrases = _getSubsets(botMessageWords, Math.min(wordCount, botMessageWords.length)).map(subset => subset.join(' '));
|
|
2250
2251
|
let subsetPhraseFound = null;
|
|
2251
2252
|
for (const subsetPhrase of subsetPhrases) {
|
|
2252
2253
|
const localWer = wordErrorRate__default["default"].wordErrorRate(subsetPhrase, wildcardPart).toFixed(2);
|
|
@@ -2255,7 +2256,9 @@ const calculateWer$1 = (str, pattern) => {
|
|
|
2255
2256
|
wer = localWer;
|
|
2256
2257
|
}
|
|
2257
2258
|
}
|
|
2258
|
-
|
|
2259
|
+
if (lodash__default["default"].isNil(subsetPhraseFound)) {
|
|
2260
|
+
throw new Error('Word Error Asserter: Something went wrong here, please try to modify your assertion!');
|
|
2261
|
+
}
|
|
2259
2262
|
errors.push(_getErrors(_getWords(wildcardPart), _getWords(subsetPhraseFound)));
|
|
2260
2263
|
}
|
|
2261
2264
|
let errCount = 0;
|
|
@@ -2264,6 +2267,7 @@ const calculateWer$1 = (str, pattern) => {
|
|
|
2264
2267
|
errCount += err.filter(err => err === true).length;
|
|
2265
2268
|
allCount += err.length;
|
|
2266
2269
|
}
|
|
2270
|
+
debug$l(`Word Error Rate Asserter - Compared Bot Message '${botMessage}' / '${utt}': ${(errCount / allCount).toFixed(2)}`);
|
|
2267
2271
|
return (errCount / allCount).toFixed(2);
|
|
2268
2272
|
};
|
|
2269
2273
|
var helper = {
|
|
@@ -5729,6 +5733,7 @@ var ScriptingProvider_1 = class ScriptingProvider {
|
|
|
5729
5733
|
convo,
|
|
5730
5734
|
convoStep,
|
|
5731
5735
|
scriptingMemory,
|
|
5736
|
+
container,
|
|
5732
5737
|
args: [],
|
|
5733
5738
|
isGlobal: true,
|
|
5734
5739
|
...rest
|
|
@@ -5771,6 +5776,7 @@ var ScriptingProvider_1 = class ScriptingProvider {
|
|
|
5771
5776
|
convo,
|
|
5772
5777
|
convoStep,
|
|
5773
5778
|
scriptingMemory,
|
|
5779
|
+
container,
|
|
5774
5780
|
args: [],
|
|
5775
5781
|
isGlobal: true,
|
|
5776
5782
|
...rest
|