theprogrammablemind_4wp 7.10.0-beta.10 → 7.10.0-beta.12

Sign up to get free protection for your applications and to get access to all the features.
package/client.js CHANGED
@@ -637,7 +637,7 @@ const loadInstance = (config, instance) => {
637
637
  // config.addInternal(results, useOldVersion = true, skipObjects = false, includeNamespaces = true, allowNameToBeNull = false)
638
638
  // config.addInternal(config.template.queries[i], { handleCalculatedProps: true } )
639
639
  const uuid = config.nameToUUID(instance.name)
640
- config.addInternal(instance.template.queries[i], { uuid, addFirst: true, handleCalculatedProps: true } )
640
+ config.addInternal(_.cloneDeep(instance.template.queries[i]), { uuid, addFirst: true, handleCalculatedProps: true } )
641
641
  } else if (results.apply) {
642
642
  const objects = config.get('objects')
643
643
  const args = { objects, getObjects: getObjects(objects) }
@@ -1466,7 +1466,18 @@ const knowledgeModuleImpl = async ({
1466
1466
  ...rest
1467
1467
  } = {}) => {
1468
1468
 
1469
- template = _.cloneDeep(template)
1469
+ /*
1470
+ if (description == 'fastfood related concepts') {
1471
+ debugger
1472
+ global.old = template.template.queries[91].bridges[0]
1473
+ }
1474
+ let old
1475
+ if (template && template.template && template.template.queries) {
1476
+ old = template.template.queries
1477
+ template.template.queries = _.cloneDeep(template.template.queries)
1478
+ template.wasCopied = true
1479
+ }
1480
+ */
1470
1481
 
1471
1482
  const unknownArgs = Object.keys(rest)
1472
1483
  if (unknownArgs.length > 0) {
@@ -1770,7 +1781,6 @@ const knowledgeModuleImpl = async ({
1770
1781
 
1771
1782
  if (template) {
1772
1783
  let needsRebuild
1773
- console.log('template.template needs rebuild', template.template)
1774
1784
  if (args.rebuildTemplate && !args.rebuildTemplateFull) {
1775
1785
  // get the startOfChanges for the partial rebuild
1776
1786
  needsRebuild = config.needsRebuild(template.template, template.instance, { ...options, rebuild: false })
@@ -2018,6 +2028,12 @@ const knowledgeModuleImpl = async ({
2018
2028
  printConfig()
2019
2029
  } else {
2020
2030
  const initConfig = (config) => {
2031
+ if (template) {
2032
+ if (config.needsRebuild(template.template, template.instance, { isModule: !isProcess }).needsRebuild) {
2033
+ const error = `This module "${config.name}" cannot be used because the instance file needs rebuilding. Run on the command line with no arguments or the -rt argument to rebuild.`
2034
+ throw new Error(error)
2035
+ }
2036
+ }
2021
2037
  setupConfig(config)
2022
2038
 
2023
2039
  let loadForTesting = false
@@ -2045,11 +2061,6 @@ const knowledgeModuleImpl = async ({
2045
2061
  }
2046
2062
 
2047
2063
  if (template) {
2048
- console.log('template.template needs rebuild', template.template)
2049
- if (config.needsRebuild(template.template, template.instance, { isModule: !isProcess }).needsRebuild) {
2050
- const error = `This module "${config.name}" cannot be used because the instance file needs rebuilding. Run on the command line with no arguments or the -rt argument to rebuild.`
2051
- throw new Error(error)
2052
- }
2053
2064
  try {
2054
2065
  config.load(template.template, template.instance)
2055
2066
  } catch( e ) {
package/package.json CHANGED
@@ -65,6 +65,6 @@
65
65
  "json-stable-stringify": "^1.0.1",
66
66
  "node-fetch": "^2.6.1"
67
67
  },
68
- "version": "7.10.0-beta.10",
68
+ "version": "7.10.0-beta.12",
69
69
  "license": "ISC"
70
70
  }
package/src/config.js CHANGED
@@ -347,11 +347,15 @@ const handleBridgeProps = (config, bridge, addFirst) => {
347
347
  }
348
348
 
349
349
  const handleCalculatedProps = (baseConfig, moreConfig, addFirst) => {
350
- for (let bridge of (moreConfig.bridges || [])) {
351
- const valid = [ 'after', 'before', 'bridge', 'development', 'evaluator', 'generatorp', 'generatorr', 'generatorpr', 'generators', 'id', 'convolution', 'inverted', 'isA', 'children', 'parents',
352
- 'level', 'optional', 'selector', 'semantic', 'words', /Bridge$/, 'localHierarchy', 'levelSpecificHierarchy', 'where', 'uuid' ]
353
- helpers.validProps(valid, bridge, 'bridge')
354
- handleBridgeProps(baseConfig, bridge, addFirst)
350
+ if (moreConfig.bridges) {
351
+ moreConfig.bridges = moreConfig.bridges.map((bridge) => {
352
+ bridge = {...bridge}
353
+ const valid = [ 'after', 'before', 'bridge', 'development', 'evaluator', 'generatorp', 'generatorr', 'generatorpr', 'generators', 'id', 'convolution', 'inverted', 'isA', 'children', 'parents',
354
+ 'level', 'optional', 'selector', 'semantic', 'words', /Bridge$/, 'localHierarchy', 'levelSpecificHierarchy', 'where', 'uuid' ]
355
+ helpers.validProps(valid, bridge, 'bridge')
356
+ handleBridgeProps(baseConfig, bridge, addFirst)
357
+ return bridge
358
+ })
355
359
  }
356
360
  if (moreConfig.operators) {
357
361
  moreConfig.operators = moreConfig.operators.map((operator) => {