theprogrammablemind_4wp 8.0.0-beta.48 → 8.0.0-beta.49

Sign up to get free protection for your applications and to get access to all the features.
package/client.js CHANGED
@@ -888,6 +888,7 @@ const rebuildTemplate = async ({ config, target, previousResultss, startOfChange
888
888
  associations: [],
889
889
  learned_contextual_priorities: []
890
890
  }
891
+ config.fragmentsBeingBuilt = []
891
892
  const looper = async (configs) => {
892
893
  if (configs.length === 0) {
893
894
  finish()
@@ -945,6 +946,9 @@ const rebuildTemplate = async ({ config, target, previousResultss, startOfChange
945
946
  results.development = query.development
946
947
  results.key = { query: query.query, hierarchy }
947
948
  accumulators[property].push(results)
949
+ if (isFragment) {
950
+ config.fragmentsBeingBuilt.push({ query: query.query, contexts: results.contexts })
951
+ }
948
952
  accumulators.associations = accumulators.associations.concat(results.associations)
949
953
  accumulators.learned_contextual_priorities = accumulators.learned_contextual_priorities.concat(results.learned_contextual_priorities)
950
954
  await looper(configs)
@@ -958,7 +962,7 @@ const rebuildTemplate = async ({ config, target, previousResultss, startOfChange
958
962
  const initFunction = queryOrExtraConfig
959
963
  const objects = config.get('objects')
960
964
  const args = { objects, getObjects: getObjects(objects) }
961
- setupArgs(args, config, config.logs, hierarchy)
965
+ setupArgs(args, config, config.logs, config.hierarchy)
962
966
  initFunction(args)
963
967
  accumulators[property].push({ apply: queryOrExtraConfig })
964
968
  await looper(configs)
@@ -983,6 +987,7 @@ const rebuildTemplate = async ({ config, target, previousResultss, startOfChange
983
987
  }
984
988
 
985
989
  const finish = () => {
990
+ config.fragmentsBeingBuilt = []
986
991
  const instanceName = `${target}.instance.json`
987
992
  console.log(`Writing instance file ${instanceName}`)
988
993
  const stabilizeAssociations = (associations) => {
@@ -1360,7 +1365,7 @@ const knowledgeModuleImpl = async ({
1360
1365
  // { literals: Object, patterns: Array(2), hierarchy: Array(97) }
1361
1366
  console.log('literals')
1362
1367
  for (const word in config.config.words.literals) {
1363
- console.log(' ' + word.concat(' ', ...config.config.words.literals[word].map((def) => JSON.stringify(def))))
1368
+ console.log(' ' + word.concat(...config.config.words.literals[word].map((def, i) => ((i > 0) ? ' '.repeat(4+word.length) : ' ') + JSON.stringify(def) + '\n')))
1364
1369
  }
1365
1370
  console.log('patterns')
1366
1371
  for (const pattern of config.config.words.patterns) {
package/package.json CHANGED
@@ -65,6 +65,6 @@
65
65
  "sort-json": "^2.0.0",
66
66
  "uuid": "^8.3.2"
67
67
  },
68
- "version": "8.0.0-beta.48",
68
+ "version": "8.0.0-beta.49",
69
69
  "license": "UNLICENSED"
70
70
  }
package/src/config.js CHANGED
@@ -1055,6 +1055,11 @@ class Config {
1055
1055
  return this.fragmentInstantiator(fragment.contexts)
1056
1056
  }
1057
1057
  }
1058
+ for (const fragment of (this.fragmentsBeingBuilt || [])) {
1059
+ if (fragment.query === query) {
1060
+ return this.fragmentInstantiator(fragment.contexts)
1061
+ }
1062
+ }
1058
1063
  }
1059
1064
  }
1060
1065