theprogrammablemind 7.3.5-beta.26 → 7.3.5-beta.28
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 -6
- package/package.json +1 -1
- package/runtime.js +3 -0
package/client.js
CHANGED
@@ -9,10 +9,9 @@ const stringify = require('json-stable-stringify')
|
|
9
9
|
const Lines = require('./lines')
|
10
10
|
const flattens = require('./src/flatten')
|
11
11
|
const { appendNoDups, InitCalls } = require('./src/helpers')
|
12
|
-
const sortJson = require('sort-json')
|
13
12
|
const util = require('util')
|
14
|
-
const { diffString } = require('json-diff')
|
15
13
|
const runtime = require('./runtime')
|
14
|
+
const sortJson = runtime.sortJson
|
16
15
|
|
17
16
|
const ask = (config) => (asks) => {
|
18
17
|
for (let ask of asks) {
|
@@ -895,7 +894,7 @@ const defaultInnerProcess = (config, errorHandler, responses) => {
|
|
895
894
|
console.log(responses.trace)
|
896
895
|
|
897
896
|
if (global.beforeObjects) {
|
898
|
-
console.log('objects', diffString(global.beforeObjects, config.get('objects')))
|
897
|
+
console.log('objects', runtime.jsonDiff.diffString(global.beforeObjects, config.get('objects')))
|
899
898
|
} else {
|
900
899
|
console.log('objects', util.inspect(config.get('objects'), { depth: Infinity, sorted: true }))
|
901
900
|
}
|
@@ -1379,7 +1378,7 @@ const knowledgeModule = async ({
|
|
1379
1378
|
const l = (n, hasError) => {
|
1380
1379
|
if (n === 0) {
|
1381
1380
|
if (hasError) {
|
1382
|
-
|
1381
|
+
runtime.process.exit(-1)
|
1383
1382
|
}
|
1384
1383
|
return
|
1385
1384
|
}
|
@@ -1425,7 +1424,7 @@ const knowledgeModule = async ({
|
|
1425
1424
|
l(n - 1, hasError || newError)
|
1426
1425
|
}).catch((error) => {
|
1427
1426
|
console.error(error)
|
1428
|
-
|
1427
|
+
runtime.process.exit(-1)
|
1429
1428
|
errorHandler(error)
|
1430
1429
|
})
|
1431
1430
|
}
|
@@ -1434,7 +1433,7 @@ const knowledgeModule = async ({
|
|
1434
1433
|
test()
|
1435
1434
|
}
|
1436
1435
|
} else if (args.loop) {
|
1437
|
-
const readline =
|
1436
|
+
const readline = runtime.readline.createInterface({ input: runtime.process.stdin, output: runtime.process.stdout })
|
1438
1437
|
const f = () => readline.question('Enter query? (newline to quit) ', query => {
|
1439
1438
|
query = query.trim()
|
1440
1439
|
if (query.length === 0) {
|
package/package.json
CHANGED
package/runtime.js
CHANGED
@@ -8,4 +8,7 @@ module.exports = {
|
|
8
8
|
child_process: "Should not be called in the browser",
|
9
9
|
fs: "Should not be called in the browser",
|
10
10
|
ArgumentParser: "Should not be called in the browser",
|
11
|
+
readline: "Should not be called in the browser",
|
12
|
+
jsonDiff: "Should not be called in the browser",
|
13
|
+
sortJson: "Should not be called in the browser",
|
11
14
|
}
|