theprogrammablemind_4wp 9.6.3-beta.2 → 9.6.3-beta.21
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 +5 -0
- package/package.json +1 -1
- package/src/config.js +5 -1
- package/src/flatten.js +4 -4
- package/src/project.js +6 -0
- package/src/project2.js +6 -0
- package/src/semantics.js +3 -0
package/client.js
CHANGED
|
@@ -1339,6 +1339,7 @@ const knowledgeModuleImpl = async ({
|
|
|
1339
1339
|
parser.add_argument('-q', '--query', { help: 'Run the specified query' })
|
|
1340
1340
|
parser.add_argument('-f', '--filter', { help: 'for -pd only the data for the knowledge modules that start with this string will be shown' })
|
|
1341
1341
|
parser.add_argument('-ip ', '--server', { help: 'Server to run against' })
|
|
1342
|
+
parser.add_argument('--trace', { action: 'store_true', help: 'Trace the semantics and generator calls.' })
|
|
1342
1343
|
parser.add_argument('-qp ', '--queryParams', { help: 'Query params for the server call' })
|
|
1343
1344
|
parser.add_argument('-dt', '--deleteTest', { help: 'Delete the specified query from the tests file.' })
|
|
1344
1345
|
parser.add_argument('--parenthesized', { action: 'store_true', help: 'Show the generated phrases with parenthesis.' })
|
|
@@ -1402,6 +1403,10 @@ const knowledgeModuleImpl = async ({
|
|
|
1402
1403
|
|
|
1403
1404
|
// setup();
|
|
1404
1405
|
|
|
1406
|
+
if (args.trace) {
|
|
1407
|
+
process.env.TPMKMS_TRACE = true
|
|
1408
|
+
}
|
|
1409
|
+
|
|
1405
1410
|
if (args.parenthesized) {
|
|
1406
1411
|
config.parenthesized = true
|
|
1407
1412
|
}
|
package/package.json
CHANGED
package/src/config.js
CHANGED
|
@@ -115,6 +115,10 @@ const debugOperator = (operator) => {
|
|
|
115
115
|
// debug operator hit
|
|
116
116
|
debugger // eslint-disable-line no-debugger
|
|
117
117
|
}
|
|
118
|
+
if ((`${operator.pattern || operator}`).includes(global.entodictonDebugOperator)) {
|
|
119
|
+
// debug operator hit
|
|
120
|
+
debugger // eslint-disable-line no-debugger
|
|
121
|
+
}
|
|
118
122
|
}
|
|
119
123
|
}
|
|
120
124
|
|
|
@@ -987,7 +991,7 @@ class Config {
|
|
|
987
991
|
getInfo () {
|
|
988
992
|
const name = this.name
|
|
989
993
|
const includes = this.configs.slice(1).map((km) => km.config.name)
|
|
990
|
-
includes.sort()
|
|
994
|
+
// includes.sort()
|
|
991
995
|
const visibleExamples = []
|
|
992
996
|
for (const test of this.tests) {
|
|
993
997
|
if (!test.developerTest) {
|
package/src/flatten.js
CHANGED
|
@@ -109,7 +109,7 @@ const flatten = (markers, value) => {
|
|
|
109
109
|
const keys = []
|
|
110
110
|
const valuess = []
|
|
111
111
|
const unchanged = {}
|
|
112
|
-
DEBUG('properties', JSON.stringify(properties, null, 2))
|
|
112
|
+
DEBUG('properties', () => JSON.stringify(properties, null, 2))
|
|
113
113
|
for (const key in properties) {
|
|
114
114
|
let wf = false
|
|
115
115
|
let values
|
|
@@ -133,11 +133,11 @@ const flatten = (markers, value) => {
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
const propertiess = []
|
|
136
|
-
DEBUG('-----------> valuess', JSON.stringify(valuess))
|
|
137
|
-
DEBUG('-----------> cartesian(valuess)', JSON.stringify(cartesian(valuess)))
|
|
136
|
+
DEBUG('-----------> valuess', () => JSON.stringify(valuess))
|
|
137
|
+
DEBUG('-----------> cartesian(valuess)', () => JSON.stringify(cartesian(valuess)))
|
|
138
138
|
// for (let values of itertools.product(*valuess)) {
|
|
139
139
|
const cp = cartesian(...valuess)
|
|
140
|
-
DEBUG('-----------> cp', JSON.stringify(cp))
|
|
140
|
+
DEBUG('-----------> cp', () => JSON.stringify(cp))
|
|
141
141
|
for (const values of cartesian(...valuess)) {
|
|
142
142
|
// properties = copy.deepcopy(unchanged)
|
|
143
143
|
properties = _.cloneDeep(unchanged)
|
package/src/project.js
CHANGED
|
@@ -23,6 +23,12 @@ const project = (object, filter) => {
|
|
|
23
23
|
return object
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
if (object.checks) {
|
|
27
|
+
for (const check in object.checks) {
|
|
28
|
+
filter.push(check)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
26
32
|
const projection = {}
|
|
27
33
|
const set = (property, value) => {
|
|
28
34
|
if (value === null || value === undefined) {
|
package/src/project2.js
CHANGED
|
@@ -16,6 +16,7 @@ function project(source, filters, path=[]) {
|
|
|
16
16
|
if (['boolean', 'string', 'number'].includes(typeof source)) {
|
|
17
17
|
return source
|
|
18
18
|
}
|
|
19
|
+
|
|
19
20
|
if (Array.isArray(source)) {
|
|
20
21
|
const result = []
|
|
21
22
|
for (const value of source) {
|
|
@@ -45,6 +46,11 @@ function project(source, filters, path=[]) {
|
|
|
45
46
|
|
|
46
47
|
// Get the properties to include from the apply function
|
|
47
48
|
let properties = filter.apply(source);
|
|
49
|
+
if (source?.checks) {
|
|
50
|
+
for (const check of source.checks) {
|
|
51
|
+
properties.push(check)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
48
54
|
|
|
49
55
|
// update
|
|
50
56
|
const updatedProperties = []
|
package/src/semantics.js
CHANGED
|
@@ -205,6 +205,9 @@ class Semantics {
|
|
|
205
205
|
continueWasCalled = true
|
|
206
206
|
}
|
|
207
207
|
args._continue = _continue
|
|
208
|
+
if (process.env.TPMKMS_TRACE) {
|
|
209
|
+
console.error(semantic.toString())
|
|
210
|
+
}
|
|
208
211
|
contextPrime = await semantic.apply(args, context, s, options)
|
|
209
212
|
if (continueWasCalled) {
|
|
210
213
|
continue
|