theprogrammablemind 7.9.0 → 7.10.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 +7 -4
- package/package.json +1 -1
- package/src/config.js +5 -2
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(
|
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.
|
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
|
-
|
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
package/src/config.js
CHANGED
@@ -2401,6 +2401,9 @@ class Config {
|
|
2401
2401
|
this.checkBridges()
|
2402
2402
|
}
|
2403
2403
|
|
2404
|
+
nameToUUID(name) {
|
2405
|
+
return this.configs.find((km) => km._name == name)._uuid
|
2406
|
+
}
|
2404
2407
|
// name: namespace name
|
2405
2408
|
// others
|
2406
2409
|
// if undefined namespace applies to first loaded config
|
@@ -2781,7 +2784,7 @@ class Config {
|
|
2781
2784
|
}
|
2782
2785
|
|
2783
2786
|
// TODO get rid of useOldVersion arg
|
2784
|
-
addInternal (more, { addFirst = false, useOldVersion = true, skipObjects = false, includeNamespaces = true, allowNameToBeNull = false, handleCalculatedProps : hcps = false } = {}) {
|
2787
|
+
addInternal (more, { uuid, addFirst = false, useOldVersion = true, skipObjects = false, includeNamespaces = true, allowNameToBeNull = false, handleCalculatedProps : hcps = false } = {}) {
|
2785
2788
|
validConfigProps(more)
|
2786
2789
|
if (more instanceof Config) {
|
2787
2790
|
more.initialize({ force: false })
|
@@ -2796,7 +2799,7 @@ class Config {
|
|
2796
2799
|
|
2797
2800
|
if (hcps) {
|
2798
2801
|
handleCalculatedProps(this, more, addFirst)
|
2799
|
-
applyUUID(more, this._uuid)
|
2802
|
+
applyUUID(more, uuid || this._uuid)
|
2800
2803
|
}
|
2801
2804
|
for (const key of Object.keys(more)) {
|
2802
2805
|
const value = more[key]
|