theprogrammablemind 7.3.2-beta.3 → 7.3.2-beta.5

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/package.json CHANGED
@@ -1,4 +1,16 @@
1
1
  {
2
+ "scripts": {
3
+ "to:debug": "node inspect node_modules/.bin/jest --runInBand -t NEO",
4
+ "to": "node node_modules/.bin/jest --runInBand -t NEO",
5
+ "tod": "node inspect node_modules/.bin/jest --runInBand -t NEO",
6
+ "lint:fix": "eslint \"**/*.js\" --fix",
7
+ "test:watch": "npm run test -- --watch",
8
+ "lint": "eslint \"**/*.js\"",
9
+ "test": "jest --config ./jest.config.json",
10
+ "test:debug": "node inspect node_modules/.bin/jest --runInBand --config ./jest.config.json"
11
+ },
12
+ "author": "dev@thinktelligence.com",
13
+ "name": "theprogrammablemind",
2
14
  "keywords": [
3
15
  "NLP",
4
16
  "NLU",
@@ -8,45 +20,6 @@
8
20
  "natural language understanding",
9
21
  "chatbot"
10
22
  ],
11
- "scripts": {
12
- "to:debug": "node inspect node_modules/.bin/jest --runInBand -t NEO",
13
- "lint:fix": "eslint \"**/*.js\" --fix",
14
- "test:watch": "npm run test -- --watch",
15
- "test:debug": "node inspect node_modules/.bin/jest --runInBand --config ./jest.config.json",
16
- "test": "jest --config ./jest.config.json",
17
- "to": "node node_modules/.bin/jest --runInBand -t NEO",
18
- "lint": "eslint \"**/*.js\"",
19
- "tod": "node inspect node_modules/.bin/jest --runInBand -t NEO"
20
- },
21
- "version": "7.3.2-beta.3",
22
- "dependencies": {
23
- "readline": "^1.3.0",
24
- "json-diff": "^1.0.3",
25
- "scriptjs": "^2.5.9",
26
- "sort-json": "^2.0.0",
27
- "lodash": "^4.17.20",
28
- "deep-equal": "^2.0.4",
29
- "json-stable-stringify": "^1.0.1",
30
- "underscore": "^1.13.1",
31
- "fs": "0.0.1-security",
32
- "uuid": "^8.3.2",
33
- "base-64": "^1.0.0",
34
- "node-fetch": "^2.6.1"
35
- },
36
- "name": "theprogrammablemind",
37
- "devDependencies": {
38
- "eslint-plugin-promise": "^5.1.0",
39
- "@typescript-eslint/eslint-plugin": "^4.28.4",
40
- "eslint-config-standard": "^16.0.3",
41
- "eslint-plugin-import": "^2.23.4",
42
- "@typescript-eslint/parser": "^4.28.4",
43
- "eslint-plugin-node": "^11.1.0",
44
- "eslint": "^7.31.0",
45
- "jest": "^26.6.3"
46
- },
47
- "author": "dev@thinktelligence.com",
48
- "license": "ISC",
49
- "main": "index.js",
50
23
  "files": [
51
24
  "client.js",
52
25
  "index.js",
@@ -61,5 +34,32 @@
61
34
  "src/digraph.js",
62
35
  "src/generators.js",
63
36
  "src/semantics.js"
64
- ]
37
+ ],
38
+ "devDependencies": {
39
+ "eslint-plugin-node": "^11.1.0",
40
+ "eslint": "^7.31.0",
41
+ "eslint-config-standard": "^16.0.3",
42
+ "eslint-plugin-promise": "^5.1.0",
43
+ "@typescript-eslint/parser": "^4.28.4",
44
+ "eslint-plugin-import": "^2.23.4",
45
+ "jest": "^26.6.3",
46
+ "@typescript-eslint/eslint-plugin": "^4.28.4"
47
+ },
48
+ "license": "ISC",
49
+ "dependencies": {
50
+ "readline": "^1.3.0",
51
+ "scriptjs": "^2.5.9",
52
+ "node-fetch": "^2.6.1",
53
+ "deep-equal": "^2.0.4",
54
+ "base-64": "^1.0.0",
55
+ "lodash": "^4.17.20",
56
+ "uuid": "^8.3.2",
57
+ "json-diff": "^1.0.3",
58
+ "fs": "0.0.1-security",
59
+ "json-stable-stringify": "^1.0.1",
60
+ "sort-json": "^2.0.0",
61
+ "underscore": "^1.13.1"
62
+ },
63
+ "main": "index.js",
64
+ "version": "7.3.2-beta.5"
65
65
  }
package/src/config.js CHANGED
@@ -1230,10 +1230,12 @@ class Config {
1230
1230
  return true
1231
1231
  }
1232
1232
 
1233
+ /*
1233
1234
  dump(fn) {
1234
1235
  const fs = require('fs')
1235
1236
  fs.writeFileSync(fn, JSON.stringify(this.config, 0, 2))
1236
1237
  }
1238
+ */
1237
1239
 
1238
1240
  copy (options = {}) {
1239
1241
  this.valid()
package/src/generators.js CHANGED
@@ -1,6 +1,5 @@
1
1
  const { args: contextArgs, normalizeGenerator } = require('./helpers')
2
2
  const Lines = require('../lines')
3
- const sortJson = require('sort-json')
4
3
  const helpers = require('./helpers')
5
4
 
6
5
  class Generator {
@@ -212,8 +211,8 @@ class Generators {
212
211
  lines.setElement(0, 2, generator.toString())
213
212
  lines.newRow()
214
213
  lines.setElement(0, 1, 'TO')
215
- lines.setElement(0, 2, `(HASHCODE ${helpers.hashCode(JSON.stringify(sortJson(context, { depth: 25 })))})`)
216
- lines.setElement(1, 2, JSON.stringify(sortJson(context, { depth: 25 }), null, 2))
214
+ lines.setElement(0, 2, `(HASHCODE ${helpers.hashCode(JSON.stringify(helpers.sortJson(context, { depth: 25 })))})`)
215
+ lines.setElement(1, 2, JSON.stringify(helpers.sortJson(context, { depth: 25 }), null, 2))
217
216
  lines.newRow()
218
217
  lines.setElement(0, 1, 'STACK')
219
218
  lines.setElement(0, 2, stack)
@@ -254,8 +253,8 @@ class Generators {
254
253
  lines.setElement(0, 1, 'DEBUG')
255
254
  lines.setElement(0, 2, `To debug this use args.callId == '${args.calls.current()}'`)
256
255
  lines.setElement(0, 1, 'TO')
257
- lines.setElement(0, 2, `(HASHCODE ${helpers.hashCode(JSON.stringify(sortJson(context, { depth: 25 })))})`)
258
- lines.setElement(1, 2, JSON.stringify(sortJson(context, { depth: 25 }), null, 2))
256
+ lines.setElement(0, 2, `(HASHCODE ${helpers.hashCode(JSON.stringify(helpers.sortJson(context, { depth: 25 })))})`)
257
+ lines.setElement(1, 2, JSON.stringify(helpers.sortJson(context, { depth: 25 }), null, 2))
259
258
  this.logs.push(lines.toString())
260
259
  }
261
260
  applied = true
package/src/helpers.js CHANGED
@@ -213,4 +213,8 @@ const hashCode = (str) => {
213
213
  return hash;
214
214
  };
215
215
 
216
- module.exports = { args, safeEquals, appendNoDups, hashIndexesGet, hashIndexesSet, translationMapping, normalizeGenerator, normalizeSemantic, isArray, isObject, isCompound, InitCalls, hashCode }
216
+ const sortJson = (json) => {
217
+ return json
218
+ }
219
+
220
+ module.exports = { args, safeEquals, appendNoDups, hashIndexesGet, hashIndexesSet, translationMapping, normalizeGenerator, normalizeSemantic, isArray, isObject, isCompound, InitCalls, hashCode, sortJson }
package/src/semantics.js CHANGED
@@ -1,6 +1,5 @@
1
1
  const { args: contextArgs, normalizeGenerator, normalizeSemantic } = require('./helpers')
2
2
  const Lines = require('../lines')
3
- const sortJson = require('sort-json')
4
3
  const helpers = require('./helpers')
5
4
 
6
5
  class Semantic {
@@ -198,8 +197,8 @@ class Semantics {
198
197
  lines.setElement(0, 2, semantic.toString())
199
198
  lines.newRow()
200
199
  lines.setElement(0, 1, 'TO')
201
- lines.setElement(0, 2, `(HASHCODE ${helpers.hashCode(JSON.stringify(sortJson(context, { depth: 25 })))})`)
202
- lines.setElement(1, 2, JSON.stringify(sortJson(context, { depth: 25 }), null, 2))
200
+ lines.setElement(0, 2, `(HASHCODE ${helpers.hashCode(JSON.stringify(helpers.sortJson(context, { depth: 25 })))})`)
201
+ lines.setElement(1, 2, JSON.stringify(helpers.sortJson(context, { depth: 25 }), null, 2))
203
202
  lines.newRow()
204
203
  lines.setElement(0, 1, 'STACK')
205
204
  lines.setElement(0, 2, stack)
@@ -233,8 +232,8 @@ class Semantics {
233
232
  lines.setElement(0, 2, semantic.toString())
234
233
  lines.newRow()
235
234
  lines.setElement(0, 1, 'TO')
236
- lines.setElement(0, 2, `(HASHCODE ${helpers.hashCode(JSON.stringify(sortJson(context, { depth: 25 })))})`)
237
- lines.setElement(1, 2, JSON.stringify(sortJson(context, { depth: 25 }), null, 2))
235
+ lines.setElement(0, 2, `(HASHCODE ${helpers.hashCode(JSON.stringify(helpers.sortJson(context, { depth: 25 })))})`)
236
+ lines.setElement(1, 2, JSON.stringify(helpers.sortJson(context, { depth: 25 }), null, 2))
238
237
  lines.newRow()
239
238
  lines.setElement(0, 1, 'STACK')
240
239
  lines.setElement(0, 2, stack)
@@ -243,7 +242,7 @@ class Semantics {
243
242
  lines.setElement(0, 2, `To debug this use args.callId == '${args.calls.current()}'`)
244
243
  lines.newRow()
245
244
  lines.setElement(0, 1, 'RESULT')
246
- lines.setElement(0, 2, `(HASHCODE ${helpers.hashCode(JSON.stringify(sortJson(contextPrime, { depth: 25 })))})`)
245
+ lines.setElement(0, 2, `(HASHCODE ${helpers.hashCode(JSON.stringify(helpers.sortJson(contextPrime, { depth: 25 })))})`)
247
246
  lines.setElement(1, 2, JSON.stringify(contextPrime, null, 2))
248
247
  this.logs.push(lines.toString())
249
248
  }
@@ -267,8 +266,8 @@ class Semantics {
267
266
  lines.setElement(0, 2, stack)
268
267
  lines.newRow()
269
268
  lines.setElement(0, 1, 'TO')
270
- lines.setElement(0, 2, `(HASHCODE ${helpers.hashCode(JSON.stringify(sortJson(context, { depth: 25 })))})`)
271
- lines.setElement(1, 2, JSON.stringify(sortJson(context, { depth: 25 }), null, 2))
269
+ lines.setElement(0, 2, `(HASHCODE ${helpers.hashCode(JSON.stringify(helpers.sortJson(context, { depth: 25 })))})`)
270
+ lines.setElement(1, 2, JSON.stringify(helpers.sortJson(context, { depth: 25 }), null, 2))
272
271
  this.logs.push(lines.toString())
273
272
  }
274
273
  return contextPrime