theprogrammablemind_4wp 7.10.0-beta.1 → 7.10.0-beta.10

Sign up to get free protection for your applications and to get access to all the features.
package/client.js CHANGED
@@ -362,7 +362,7 @@ const writeTest = (fn, query, objects, generated, paraphrases, responses, contex
362
362
  }
363
363
  associations.sort()
364
364
  // tests[query] = sortJson({ paraphrases, responses, contexts, objects: convertToStable(objects), associations, metadata, config, developerTest: saveDeveloper }, { depth: 25 })
365
- results = sortJson({
365
+ const results = sortJson({
366
366
  query,
367
367
  paraphrases,
368
368
  responses,
@@ -667,7 +667,11 @@ const loadInstance = (config, instance) => {
667
667
  global.transitoryMode = transitoryMode
668
668
  }
669
669
 
670
- const _process = async (config, query, { initializer, commandLineArgs, credentials, writeTests, isTest, saveDeveloper, rebuildingTemplate, testConfig, testsFN, errorHandler = defaultErrorHandler } = {}) => {
670
+ const throwErrorHandler = (error) => {
671
+ throw error
672
+ }
673
+
674
+ const _process = async (config, query, { initializer, commandLineArgs, credentials, writeTests, isTest, saveDeveloper, rebuildingTemplate, testConfig, testsFN, errorHandler = throwErrorHandler } = {}) => {
671
675
  if (credentials) {
672
676
  config.server(credentials.server, credentials.key)
673
677
  }
@@ -1462,6 +1466,8 @@ const knowledgeModuleImpl = async ({
1462
1466
  ...rest
1463
1467
  } = {}) => {
1464
1468
 
1469
+ template = _.cloneDeep(template)
1470
+
1465
1471
  const unknownArgs = Object.keys(rest)
1466
1472
  if (unknownArgs.length > 0) {
1467
1473
  throw new Error(`Unknown arguments to knowledgeModule: ${unknownArgs.join()}`)
@@ -1764,6 +1770,7 @@ const knowledgeModuleImpl = async ({
1764
1770
 
1765
1771
  if (template) {
1766
1772
  let needsRebuild
1773
+ console.log('template.template needs rebuild', template.template)
1767
1774
  if (args.rebuildTemplate && !args.rebuildTemplateFull) {
1768
1775
  // get the startOfChanges for the partial rebuild
1769
1776
  needsRebuild = config.needsRebuild(template.template, template.instance, { ...options, rebuild: false })
@@ -2038,6 +2045,7 @@ const knowledgeModuleImpl = async ({
2038
2045
  }
2039
2046
 
2040
2047
  if (template) {
2048
+ console.log('template.template needs rebuild', template.template)
2041
2049
  if (config.needsRebuild(template.template, template.instance, { isModule: !isProcess }).needsRebuild) {
2042
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.`
2043
2051
  throw new Error(error)
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.1",
68
+ "version": "7.10.0-beta.10",
69
69
  "license": "ISC"
70
70
  }
package/src/config.js CHANGED
@@ -204,6 +204,9 @@ const handleBridgeProps = (config, bridge, addFirst) => {
204
204
  ecatch(`While processing the bridge for ${bridge.id}#${bridge.level}`,
205
205
  () => {
206
206
  if (!bridge.bridge) {
207
+ if (bridge.id == 'modification') {
208
+ debugger
209
+ }
207
210
  bridge.bridge = "{ ...next(operator) }"
208
211
  }
209
212
  if (!bridge.level) {
@@ -1103,7 +1106,8 @@ class Config {
1103
1106
  }
1104
1107
  }
1105
1108
 
1106
- if (startOfChanges) {
1109
+ const debug = true
1110
+ if (debug && startOfChanges) {
1107
1111
  console.log('templateQueries[startOfChanges]', templateQueries[startOfChanges]);
1108
1112
  console.log('instanceQueries[startOfChanges]', instanceQueries[startOfChanges]);
1109
1113
  }
@@ -1114,7 +1118,6 @@ class Config {
1114
1118
  }
1115
1119
  // const sameQueries = helpers.safeEquals(toCanonicalQueries(template.queries || []).map(helpers.updateQueries), toCanonicalQueries(instance.queries || []))
1116
1120
 
1117
- const debug = false
1118
1121
  if (debug) {
1119
1122
  if (!(instance && sameQueries && sameFragments)) {
1120
1123
  if (!sameQueries) {