theprogrammablemind 7.9.0 → 7.10.0-beta.0

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/client.js CHANGED
@@ -146,7 +146,7 @@ class ErrorReason extends Error {
146
146
  }
147
147
  }
148
148
 
149
- const setupArgs = (args, config, logs, hierarchy) => {
149
+ const setupArgs = (args, config, logs, hierarchy, uuidForScoping) => {
150
150
  config.setArgs(args)
151
151
  args.calls = new InitCalls(args.isInstance ? `${args.isInstance}#${config.name}` : config.name)
152
152
  if (global.theprogrammablemind && global.theprogrammablemind.loadForTesting) {
@@ -184,7 +184,7 @@ const setupArgs = (args, config, logs, hierarchy) => {
184
184
  apis: getAPIs(uuid)
185
185
  }
186
186
  }
187
- Object.assign(args, args.getUUIDScoped(this.uuid))
187
+ Object.assign(args, args.getUUIDScoped(uuidForScoping))
188
188
  args.breakOnSemantics = false
189
189
  args.theDebugger = {
190
190
  breakOnSemantics: (value) => args.breakOnSemantics = value
@@ -636,7 +636,8 @@ const loadInstance = (config, instance) => {
636
636
  if (results.extraConfig) {
637
637
  // config.addInternal(results, useOldVersion = true, skipObjects = false, includeNamespaces = true, allowNameToBeNull = false)
638
638
  // config.addInternal(config.template.queries[i], { handleCalculatedProps: true } )
639
- config.addInternal(instance.template.queries[i], { addFirst: true, handleCalculatedProps: true } )
639
+ const uuid = config.nameToUUID(instance.name)
640
+ config.addInternal(instance.template.queries[i], { uuid, addFirst: true, handleCalculatedProps: true } )
640
641
  } else if (results.apply) {
641
642
  const objects = config.get('objects')
642
643
  const args = { objects, getObjects: getObjects(objects) }
@@ -644,7 +645,9 @@ const loadInstance = (config, instance) => {
644
645
  args.isInstance = `instance${i}`
645
646
  args.instance = instance.queries[i]
646
647
  }
647
- setupArgs(args, config, config.logs, hierarchy)
648
+
649
+ const uuid = config.nameToUUID(instance.name)
650
+ setupArgs(args, config, config.logs, hierarchy, uuid)
648
651
  results.apply(args)
649
652
  } else {
650
653
  if (results.skipSemantics) {
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.9.0",
68
+ "version": "7.10.0-beta.0",
69
69
  "license": "ISC"
70
70
  }
package/src/config.js CHANGED
@@ -23,6 +23,7 @@ const indent = (string, indent) => {
23
23
  }
24
24
 
25
25
  const config_toServer = (config) => {
26
+ // cant change things because copy breaks something
26
27
  }
27
28
 
28
29
  const debugPriority = (priority) => {
@@ -2401,6 +2402,9 @@ class Config {
2401
2402
  this.checkBridges()
2402
2403
  }
2403
2404
 
2405
+ nameToUUID(name) {
2406
+ return this.configs.find((km) => km._name == name)._uuid
2407
+ }
2404
2408
  // name: namespace name
2405
2409
  // others
2406
2410
  // if undefined namespace applies to first loaded config
@@ -2781,7 +2785,7 @@ class Config {
2781
2785
  }
2782
2786
 
2783
2787
  // TODO get rid of useOldVersion arg
2784
- addInternal (more, { addFirst = false, useOldVersion = true, skipObjects = false, includeNamespaces = true, allowNameToBeNull = false, handleCalculatedProps : hcps = false } = {}) {
2788
+ addInternal (more, { uuid, addFirst = false, useOldVersion = true, skipObjects = false, includeNamespaces = true, allowNameToBeNull = false, handleCalculatedProps : hcps = false } = {}) {
2785
2789
  validConfigProps(more)
2786
2790
  if (more instanceof Config) {
2787
2791
  more.initialize({ force: false })
@@ -2796,7 +2800,7 @@ class Config {
2796
2800
 
2797
2801
  if (hcps) {
2798
2802
  handleCalculatedProps(this, more, addFirst)
2799
- applyUUID(more, this._uuid)
2803
+ applyUUID(more, uuid || this._uuid)
2800
2804
  }
2801
2805
  for (const key of Object.keys(more)) {
2802
2806
  const value = more[key]