tpmkms 8.0.0-beta.41 → 8.0.0-beta.43

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.
Files changed (66) hide show
  1. package/common/animals.js +17 -20
  2. package/common/articles.js +6 -11
  3. package/common/avatar.js +5 -9
  4. package/common/characters.js +22 -26
  5. package/common/colors.instance.json +28 -0
  6. package/common/colors.js +4 -8
  7. package/common/comparable.js +5 -9
  8. package/common/concept.js +120 -124
  9. package/common/countable.js +5 -9
  10. package/common/crew.js +36 -41
  11. package/common/currency.js +25 -43
  12. package/common/dialogues.js +46 -49
  13. package/common/dimension.instance.json +8 -8
  14. package/common/dimension.js +7 -13
  15. package/common/edible.instance.json +112 -0
  16. package/common/edible.js +3 -8
  17. package/common/emotions.js +35 -38
  18. package/common/evaluate.js +5 -11
  19. package/common/events.js +6 -10
  20. package/common/fastfood.instance.json +401 -317
  21. package/common/fastfood.js +53 -63
  22. package/common/formulas.instance.json +10 -10
  23. package/common/formulas.js +7 -14
  24. package/common/gdefaults.js +8 -10
  25. package/common/help.js +7 -12
  26. package/common/hierarchy.js +8 -12
  27. package/common/javascript.js +7 -14
  28. package/common/kirk.js +5 -8
  29. package/common/length.js +4 -8
  30. package/common/listener.js +5 -11
  31. package/common/math.instance.json +16 -16
  32. package/common/math.js +6 -10
  33. package/common/meta.js +5 -22
  34. package/common/nameable.js +6 -13
  35. package/common/negation.js +5 -5
  36. package/common/numbers.js +5 -9
  37. package/common/ordering.instance.json +68 -0
  38. package/common/ordering.js +80 -86
  39. package/common/people.js +8 -12
  40. package/common/percentages.js +5 -9
  41. package/common/pipboy.instance.json +84 -28
  42. package/common/pipboy.js +7 -15
  43. package/common/pokemon.js +7 -20
  44. package/common/pos.js +4 -5
  45. package/common/pressure.js +4 -8
  46. package/common/properties.js +6 -12
  47. package/common/punctuation.js +5 -5
  48. package/common/reports.instance.json +1 -1
  49. package/common/reports.js +9 -14
  50. package/common/scorekeeper.js +8 -12
  51. package/common/sdefaults.js +4 -5
  52. package/common/sizeable.js +5 -9
  53. package/common/spock.js +5 -8
  54. package/common/stgame.js +18 -23
  55. package/common/stm.js +9 -15
  56. package/common/tell.js +9 -13
  57. package/common/temperature.instance.json +0 -112
  58. package/common/temperature.js +4 -8
  59. package/common/tester.js +1 -1
  60. package/common/testing.js +5 -9
  61. package/common/time.js +18 -23
  62. package/common/tokenize.js +4 -5
  63. package/common/ui.js +6 -12
  64. package/common/weight.js +4 -8
  65. package/common/yesno.js +5 -5
  66. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- const { Config, knowledgeModule, where, Digraph } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where, Digraph } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const dimension = require('./dimension.js')
4
4
  const temperature_tests = require('./temperature.test.json')
@@ -14,16 +14,12 @@ const template = {
14
14
  ],
15
15
  }
16
16
 
17
- const createConfig = async () => {
18
- const config = new Config({ name: 'temperature' }, module)
19
- await config.add(dimension)
20
- return config
21
- }
22
-
23
17
  knowledgeModule({
18
+ config: { name: 'temperature' },
19
+ includes: [dimension],
20
+
24
21
  module,
25
22
  description: 'Weight dimension',
26
- createConfig,
27
23
  test: {
28
24
  name: './temperature.test.json',
29
25
  contents: temperature_tests,
package/common/tester.js CHANGED
@@ -1,4 +1,4 @@
1
- const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const tester_tests = require('./tester.test.json')
4
4
  const ArgumentParser = require('argparse').ArgumentParser
package/common/testing.js CHANGED
@@ -1,9 +1,9 @@
1
- const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const testing_tests = require('./testing.test.json')
4
4
  const gdefaults = require('./gdefaults')
5
5
 
6
- let configStruct = {
6
+ const config = {
7
7
  name: 'testing',
8
8
  operators: [
9
9
  { pattern: "([testingEvaluate] ([testingValue]))" },
@@ -30,16 +30,12 @@ let configStruct = {
30
30
  ],
31
31
  };
32
32
 
33
- const createConfig = async () => {
34
- const config = new Config(configStruct, module)
35
- await config.add(gdefaults)
36
- return config
37
- }
38
-
39
33
  knowledgeModule({
34
+ config,
35
+ includes: [gdefaults],
36
+
40
37
  module,
41
38
  description: 'code for testing',
42
- createConfig,
43
39
  test: {
44
40
  name: './testing.test.json',
45
41
  contents: testing_tests
package/common/time.js CHANGED
@@ -1,4 +1,4 @@
1
- const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const tell = require('./tell')
4
4
  const countable = require('./countable')
@@ -14,7 +14,7 @@ const pad = (v, l) => {
14
14
 
15
15
  class API {
16
16
  // gets the contexts for doing the happening
17
- semantics({context, isModule, args, kms}) {
17
+ semantics({context, args, kms}) {
18
18
  const api = kms.time.api
19
19
  const values = args({ types: ['ampm', 'time'], properties: ['one', 'two'] })
20
20
  const ampm = context[values[0]]
@@ -36,9 +36,8 @@ class API {
36
36
  initialize() {
37
37
  }
38
38
  }
39
- const api = new API()
40
39
 
41
- const configStruct = {
40
+ const config = {
42
41
  name: 'time',
43
42
  operators: [
44
43
  "([time])",
@@ -170,31 +169,27 @@ const configStruct = {
170
169
  ],
171
170
  };
172
171
 
173
- const createConfig = async () => {
174
- const config = new Config(configStruct, module)
175
- config.stop_auto_rebuild()
176
- await config.add(tell, numbers, countable)
177
- await config.setApi(api)
178
- await config.initializer( ({config, objects, kms, isModule}) => {
179
- if (!isModule) {
180
- kms.time.api.newDate = () => new Date("December 25, 1995 1:59:58 pm" )
181
- }
182
- Object.assign(objects, {
183
- format: 12 // or 24
184
- });
185
- config.addSemantic({
186
- match: ({context, hierarchy, args}) => context.happening && context.marker == 'is' && args({ types: ['ampm', 'time'], properties: ['one', 'two'] }),
187
- apply: api.semantics
188
- })
172
+ const initializer = ({api, config, objects, kms, isModule}) => {
173
+ if (!isModule) {
174
+ kms.time.api.newDate = () => new Date("December 25, 1995 1:59:58 pm" )
175
+ }
176
+ Object.assign(objects, {
177
+ format: 12 // or 24
178
+ });
179
+ config.addSemantic({
180
+ match: ({context, hierarchy, args}) => context.happening && context.marker == 'is' && args({ types: ['ampm', 'time'], properties: ['one', 'two'] }),
181
+ apply: api.semantics
189
182
  })
190
- await config.restart_auto_rebuild()
191
- return config
192
183
  }
193
184
 
194
185
  knowledgeModule({
186
+ config,
187
+ includes: [tell, numbers, countable],
188
+ api: () => new API(),
189
+ initializer,
190
+
195
191
  module,
196
192
  description: 'Time related concepts',
197
- createConfig,
198
193
  test: {
199
194
  name: './time.test.json',
200
195
  contents: time_tests,
@@ -1,8 +1,8 @@
1
- const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const tokenize_tests = require('./tokenize.test.json')
4
4
 
5
- let configStruct = {
5
+ const config = {
6
6
  name: 'tokenize',
7
7
  operators: [
8
8
  "([unknown])",
@@ -31,11 +31,10 @@ let configStruct = {
31
31
  },
32
32
  };
33
33
 
34
- createConfig = async () => new Config(configStruct, module)
35
-
36
34
  knowledgeModule( {
35
+ config,
36
+
37
37
  module,
38
- createConfig,
39
38
  description: 'tokenize',
40
39
  test: {
41
40
  name: './tokenize.test.json',
package/common/ui.js CHANGED
@@ -1,4 +1,4 @@
1
- const { Config, knowledgeModule, where, Digraph } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where, Digraph } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const dialogues = require('./dialogues')
4
4
  const math = require('./math')
@@ -39,7 +39,7 @@ class API {
39
39
  again
40
40
  stop/start listening
41
41
  */
42
- const configStruct = {
42
+ const config = {
43
43
  name: 'ui',
44
44
  operators: [
45
45
  "([select])",
@@ -183,21 +183,15 @@ const template = {
183
183
  ],
184
184
  }
185
185
 
186
- const createConfig = async () => {
187
- const config = new Config(configStruct, module)
188
- config.stop_auto_rebuild()
189
- await config.add(dialogues, math)
190
- await config.setApi(new API())
191
- await config.restart_auto_rebuild()
192
- return config
193
- }
194
-
195
186
  // const config = createConfig()
196
187
 
197
188
  knowledgeModule({
189
+ config,
190
+ includes: [dialogues, math],
191
+ api: () => new API(),
192
+
198
193
  module,
199
194
  description: 'Control a ui with speech',
200
- createConfig,
201
195
  test: {
202
196
  name: './ui.test.json',
203
197
  contents: ui_tests,
package/common/weight.js CHANGED
@@ -1,4 +1,4 @@
1
- const { Config, knowledgeModule, where, Digraph } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where, Digraph } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const dimension = require('./dimension.js')
4
4
  const weight_tests = require('./weight.test.json')
@@ -34,16 +34,12 @@ const template = {
34
34
  ],
35
35
  }
36
36
 
37
- const createConfig = async () => {
38
- const config = new Config({ name: 'weight' }, module)
39
- await config.add(dimension)
40
- return config
41
- }
42
-
43
37
  knowledgeModule({
38
+ config: { name: 'weight' },
39
+ includes: [dimension],
40
+
44
41
  module,
45
42
  description: 'Weight dimension',
46
- createConfig,
47
43
  test: {
48
44
  name: './weight.test.json',
49
45
  contents: weight_tests,
package/common/yesno.js CHANGED
@@ -1,9 +1,9 @@
1
- const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const gdefaults = require('./gdefaults')
4
4
  const yesno_tests = require('./yesno.test.json')
5
5
 
6
- let configStruct = {
6
+ let config = {
7
7
  name: 'yesno',
8
8
  operators: [
9
9
  "([yes])",
@@ -22,11 +22,11 @@ let configStruct = {
22
22
  ],
23
23
  };
24
24
 
25
- const createConfig = async () => new Config(configStruct, module).add(gdefaults)
26
-
27
25
  knowledgeModule( {
26
+ config,
27
+ includes: [gdefaults],
28
+
28
29
  module,
29
- createConfig,
30
30
  description: 'yesno',
31
31
  test: {
32
32
  name: './yesno.test.json',
package/package.json CHANGED
@@ -294,8 +294,8 @@
294
294
  "table": "^6.7.1",
295
295
  "base-64": "^1.0.0",
296
296
  "argparse": "^2.0.1",
297
- "theprogrammablemind": "8.0.0-beta.41"
297
+ "theprogrammablemind": "8.0.0-beta.43"
298
298
  },
299
- "version": "8.0.0-beta.41",
299
+ "version": "8.0.0-beta.43",
300
300
  "license": "UNLICENSED"
301
301
  }