theprogrammablemind_4wp 9.6.0-beta.20 → 9.6.0-beta.23

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/package.json CHANGED
@@ -73,6 +73,6 @@
73
73
  "scriptjs": "^2.5.9",
74
74
  "uuid": "^8.3.2"
75
75
  },
76
- "version": "9.6.0-beta.20",
76
+ "version": "9.6.0-beta.23",
77
77
  "license": "UNLICENSED"
78
78
  }
package/src/config.js CHANGED
@@ -338,6 +338,7 @@ const handleBridgeProps = (config, bridge, { addFirst, uuid } = {}) => {
338
338
 
339
339
  // done in setTestConfig
340
340
  if (bridge.check) {
341
+ /*
341
342
  if (!config.testConfig) {
342
343
  config.testConfig = {}
343
344
  }
@@ -347,6 +348,7 @@ const handleBridgeProps = (config, bridge, { addFirst, uuid } = {}) => {
347
348
  if (!config.testConfig?.checks?.context) {
348
349
  config.testConfig.checks.context = []
349
350
  }
351
+ */
350
352
  config.contextChecksFromBridges.push({
351
353
  'bridge.id': bridge.id,
352
354
  'bridge.check': bridge.check,
@@ -405,9 +407,15 @@ const handleBridgeProps = (config, bridge, { addFirst, uuid } = {}) => {
405
407
  if (bridge.generatorp) {
406
408
  const match = bridge.generatorp.match || (() => true)
407
409
  const apply = typeof bridge.generatorp === 'function' ? bridge.generatorp : bridge.generatorp.apply || bridge.generatorp
408
- let level = bridge.generatorp.level >= 0 ? bridge.generatorp.level : bridge.level + 1
409
- if (!bridge.bridge) {
410
- level = 0
410
+
411
+ let level
412
+ if (bridge.generatorp.level >= 0) {
413
+ level = bridge.generatorp.level
414
+ } else {
415
+ level = bridge.level + 1
416
+ if (!bridge.bridge ) {
417
+ level = 0
418
+ }
411
419
  }
412
420
 
413
421
  const generator = {
@@ -427,7 +435,16 @@ const handleBridgeProps = (config, bridge, { addFirst, uuid } = {}) => {
427
435
  if (bridge.generatorr) {
428
436
  const match = bridge.generatorr.match || (() => true)
429
437
  const apply = typeof bridge.generatorr === 'function' ? bridge.generatorr : bridge.generatorr.apply || bridge.generatorr
430
- const level = bridge.generatorr.level >= 0 ? bridge.generatorr.level : bridge.level + 1
438
+ // const level = bridge.generatorr.level >= 0 ? bridge.generatorr.level : bridge.level + 1
439
+ let level
440
+ if (bridge.generatorr.level >= 0) {
441
+ level = bridge.generatorr.level
442
+ } else {
443
+ level = bridge.level + 1
444
+ if (!bridge.bridge ) {
445
+ level = 0
446
+ }
447
+ }
431
448
  const generator = {
432
449
  where: bridge.generatorr.where || bridge.where || helpers.where(4),
433
450
  // match: async (args) => bridge.id === args.context.marker && args.context.level === level && !args.context.paraphrase && (args.context.response || args.context.isResponse) && await match(args),
@@ -1101,19 +1118,6 @@ class Config {
1101
1118
  this.testConfig.checks.context = []
1102
1119
  }
1103
1120
  this.testConfig.checks.context = this.contextChecksFromBridges.concat(this.testConfig.checks.context)
1104
- /*
1105
- const currentTestConfig = testConfig // add bridge has added check.context's
1106
-
1107
- if (!this.testConfig.checks) {
1108
- debugger
1109
- // this.testConfig.checks =
1110
- }
1111
-
1112
- // set during bridge setup
1113
- if (currentTestConfig.checks?.context) {
1114
- this.testConfig.checks.context = currentTestConfig.checks.context.concat(this.testConfig.checks.context)
1115
- }
1116
- */
1117
1121
  }
1118
1122
 
1119
1123
  getTestConfig () {
@@ -2874,7 +2878,11 @@ class Config {
2874
2878
  let defaults = () => []
2875
2879
  if (this.loadOrdering) {
2876
2880
  for (const name of this.loadOrdering) {
2877
- const checks = this.kms[name].testConfig?.checks?.context || []
2881
+ const config = this.kms[name]
2882
+ let checks = config.testConfig?.checks?.context || []
2883
+ if (config.contextChecksFromBridges) {
2884
+ checks = config.contextChecksFromBridges.concat(checks)
2885
+ }
2878
2886
  const oldDefaults = defaults
2879
2887
  for (const check of checks) {
2880
2888
  if (!check.match) {
package/src/debug.js CHANGED
@@ -51,6 +51,7 @@ const counter = (name, { breakAt = [], debugBreak = true, tag = '' } = {}) => {
51
51
  hit(name)
52
52
  return true
53
53
  }
54
+ return counters[name]
54
55
  }
55
56
 
56
57
  const get = (name) => {