theprogrammablemind_4wp 7.5.4-beta.6 → 7.5.4-beta.7
Sign up to get free protection for your applications and to get access to all the features.
- package/client.js +8 -1
- package/package.json +1 -1
- package/src/config.js +13 -5
- package/src/generators.js +4 -2
- package/src/semantics.js +4 -2
package/client.js
CHANGED
@@ -1662,7 +1662,14 @@ function where(goUp = 2) {
|
|
1662
1662
|
const e = new Error();
|
1663
1663
|
const regexForm1 = /\((.*):(\d+):(\d+)\)$/
|
1664
1664
|
const regexForm2 = /at (.*):(\d+):(\d+)$/
|
1665
|
-
const
|
1665
|
+
const lines = e.stack.split("\n")
|
1666
|
+
let line
|
1667
|
+
for (line of lines.slice(1)) {
|
1668
|
+
if (!(line.includes("config.js:") || line.includes("client.js:"))) {
|
1669
|
+
break;
|
1670
|
+
}
|
1671
|
+
}
|
1672
|
+
// const line = e.stack.split("\n")[goUp];
|
1666
1673
|
const match = regexForm1.exec(line) || regexForm2.exec(line);
|
1667
1674
|
if (match) {
|
1668
1675
|
return `${match[1]}:${match[2]}`
|
package/package.json
CHANGED
package/src/config.js
CHANGED
@@ -74,31 +74,39 @@ const handleBridgeProps = (config, bridge) => {
|
|
74
74
|
}
|
75
75
|
if (bridge.generatorp) {
|
76
76
|
config.config.generators.unshift({
|
77
|
-
where: bridge.generatorp.where || client.where(
|
77
|
+
where: bridge.generatorp.where || bridge.where || client.where(4),
|
78
78
|
match: ({context}) => bridge.id == context.marker && context.paraphrase,
|
79
79
|
apply: (args) => bridge.generatorp(args),
|
80
|
+
applyWrapped: bridge.generatorp,
|
81
|
+
property: 'generatorp',
|
80
82
|
})
|
81
83
|
}
|
82
84
|
if (bridge.generatorr) {
|
83
85
|
config.config.generators.unshift({
|
84
86
|
// TODO merge response and isResponse
|
85
|
-
where: bridge.generatorr.where || client.where(3),
|
87
|
+
where: bridge.generatorr.where || bridge.where || client.where(3),
|
86
88
|
match: ({context}) => bridge.id == context.marker && !context.paraphrase && (context.response || context.isResponse),
|
87
89
|
apply: (args) => bridge.generatorr(args),
|
90
|
+
applyWrapped: bridge.generatorr,
|
91
|
+
property: 'generatorr',
|
88
92
|
})
|
89
93
|
}
|
90
94
|
if (bridge.evaluator) {
|
91
95
|
config.config.semantics.unshift({
|
92
|
-
where: bridge.evaluator.where || client.where(3),
|
96
|
+
where: bridge.evaluator.where || bridge.where || client.where(3),
|
93
97
|
match: ({context}) => bridge.id == context.marker && context.evaluate,
|
94
98
|
apply: (args) => bridge.evaluator(args),
|
99
|
+
applyWrapped: bridge.evaluator,
|
100
|
+
property: 'evaluator',
|
95
101
|
})
|
96
102
|
}
|
97
103
|
if (bridge.semantic) {
|
98
104
|
config.config.semantics.unshift({
|
99
|
-
where: bridge.semantic.where || client.where(3),
|
105
|
+
where: bridge.semantic.where || bridge.where || client.where(3),
|
100
106
|
match: ({context}) => bridge.id == context.marker,
|
101
107
|
apply: (args) => bridge.semantic(args),
|
108
|
+
applyWrapped: bridge.semantic,
|
109
|
+
property: 'semantic',
|
102
110
|
})
|
103
111
|
}
|
104
112
|
}
|
@@ -106,7 +114,7 @@ const handleBridgeProps = (config, bridge) => {
|
|
106
114
|
const handleCalculatedProps = (baseConfig, moreConfig) => {
|
107
115
|
for (let bridge of moreConfig.bridges) {
|
108
116
|
const valid = [ 'before', 'bridge', 'development', 'evaluator', 'generatorp', 'generatorr', 'generators', 'id', 'convolution', 'inverted', 'isA', 'children', 'parents',
|
109
|
-
'level', 'optional', 'selector', 'semantic', 'words', /Bridge$/, 'localHierarchy' ]
|
117
|
+
'level', 'optional', 'selector', 'semantic', 'words', /Bridge$/, 'localHierarchy', 'where' ]
|
110
118
|
helpers.validProps(valid, bridge, 'bridge')
|
111
119
|
handleBridgeProps(baseConfig, bridge)
|
112
120
|
}
|
package/src/generators.js
CHANGED
@@ -6,9 +6,11 @@ class Generator {
|
|
6
6
|
// constructor ({ match, apply, uuid, index, km, priority, notes }) {
|
7
7
|
constructor (generator) {
|
8
8
|
generator = normalizeGenerator(generator)
|
9
|
-
const { match, apply, uuid, index, km, priority, where, notes, debug } = generator
|
9
|
+
const { match, apply, uuid, index, km, priority, where, notes, debug, applyWrapped, property } = generator
|
10
10
|
this.match = match
|
11
11
|
this._apply = apply
|
12
|
+
this._applyWrapped = applyWrapped
|
13
|
+
this.property = property
|
12
14
|
this.uuid = uuid
|
13
15
|
this.index = index
|
14
16
|
this.km = km
|
@@ -39,7 +41,7 @@ class Generator {
|
|
39
41
|
}
|
40
42
|
|
41
43
|
toString () {
|
42
|
-
return `Generator(${this.match}, ${this._apply})`
|
44
|
+
return `Generator(${this.match}, ${this._applyWrapped || this._apply})${this.property ? `\nsee the ${this.property} property` : ''}`
|
43
45
|
}
|
44
46
|
|
45
47
|
matches (baseArgs, objects, context, hierarchy, config, options = {}) {
|
package/src/semantics.js
CHANGED
@@ -6,9 +6,11 @@ class Semantic {
|
|
6
6
|
// constructor ({match, apply, uuid, index, km, notes}) {
|
7
7
|
constructor (semantic) {
|
8
8
|
semantic = normalizeSemantic(semantic)
|
9
|
-
const { match, apply, uuid, index, km, notes, priority, debug, where } = semantic
|
9
|
+
const { match, apply, uuid, index, km, notes, priority, debug, where, applyWrapped, property } = semantic
|
10
10
|
this.matcher = match
|
11
11
|
this._apply = apply
|
12
|
+
this._applyWrapped = applyWrapped
|
13
|
+
this.property = property
|
12
14
|
this.uuid = uuid
|
13
15
|
this.index = index
|
14
16
|
this.km = km
|
@@ -27,7 +29,7 @@ class Semantic {
|
|
27
29
|
}
|
28
30
|
|
29
31
|
toString () {
|
30
|
-
return `Semantic(${this.matcher}, ${this._apply})`
|
32
|
+
return `Semantic(${this.matcher}, ${this._applyWrapped || this._apply})${this.property ? `\nsee the ${this.property} property` : ''}`
|
31
33
|
}
|
32
34
|
|
33
35
|
getAPI (config) {
|