ekms 7.12.8-beta.0 → 7.12.8-beta.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. package/common/animals.instance.json +89 -249
  2. package/common/animals.js +1 -1
  3. package/common/avatar.js +7 -5
  4. package/common/characters.js +12 -5
  5. package/common/crew.instance.json +289 -577
  6. package/common/crew.js +1 -1
  7. package/common/currency.js +0 -2
  8. package/common/dialogues.js +16 -14
  9. package/common/dimension.instance.json +747 -73
  10. package/common/dimension.js +15 -7
  11. package/common/edible.instance.json +293 -297
  12. package/common/edible.js +1 -1
  13. package/common/emotions.instance.json +29 -65
  14. package/common/emotions.js +1 -1
  15. package/common/fastfood.instance.json +517 -1473
  16. package/common/fastfood.js +1 -1
  17. package/common/formulas.instance.json +992 -0
  18. package/common/formulas.js +19 -6
  19. package/common/gdefaults.js +2 -0
  20. package/common/help.js +7 -2
  21. package/common/help.test.json +9 -5
  22. package/common/helpers.js +5 -0
  23. package/common/javascript.js +8 -6
  24. package/common/kirk.instance.json +1 -1
  25. package/common/kirk.js +1 -1
  26. package/common/length.instance.json +199 -683
  27. package/common/length.js +1 -1
  28. package/common/math.instance.json +21 -41
  29. package/common/math.js +1 -1
  30. package/common/meta.instance.json +1 -1
  31. package/common/meta.js +35 -10
  32. package/common/numbers.js +28 -24
  33. package/common/ordering.instance.json +37 -101
  34. package/common/ordering.js +1 -1
  35. package/common/people.instance.json +50 -78
  36. package/common/people.js +1 -1
  37. package/common/pipboy.instance.json +23431 -1082
  38. package/common/pipboy.js +31 -4
  39. package/common/pokemon.instance.json +41 -97
  40. package/common/pokemon.js +1 -1
  41. package/common/pressure.instance.json +61 -33
  42. package/common/pressure.js +1 -1
  43. package/common/properties.instance.json +21 -49
  44. package/common/properties.js +13 -8
  45. package/common/reports.instance.json +7 -63
  46. package/common/reports.js +9 -7
  47. package/common/scorekeeper.instance.json +1 -1
  48. package/common/scorekeeper.js +9 -7
  49. package/common/spock.instance.json +1 -1
  50. package/common/spock.js +1 -1
  51. package/common/tell.js +4 -2
  52. package/common/temperature.instance.json +65 -133
  53. package/common/temperature.js +1 -1
  54. package/common/time.js +36 -20
  55. package/common/time.test.json +66 -44
  56. package/common/tokenize.js +46 -0
  57. package/common/ui.instance.json +1 -1
  58. package/common/weight.instance.json +177 -201
  59. package/common/weight.js +1 -1
  60. package/main.js +2 -6
  61. package/package.json +6 -14
  62. package/common/dimensionTemplate.instance.json +0 -582
  63. package/common/dimensionTemplate.js +0 -35
  64. package/common/formulasTemplate.instance.json +0 -483
  65. package/common/formulasTemplate.js +0 -30
  66. package/common/formulasTemplate.test.json +0 -2
  67. package/common/pipboyTemplate.instance.json +0 -17420
  68. package/common/pipboyTemplate.js +0 -48
  69. package/common/pipboyTemplate.test.json +0 -2
  70. /package/common/{dimensionTemplate.test.json → tokenize.test.json} +0 -0
package/common/pipboy.js CHANGED
@@ -1,11 +1,12 @@
1
1
  const { Config, knowledgeModule, where, Digraph } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
- const base_km = require('./pipboyTemplate')
3
+ const hierarchy = require('./hierarchy')
4
4
  const countable = require('./countable')
5
5
  const math = require('./math')
6
6
  const comparable = require('./comparable')
7
7
  const help = require('./help')
8
8
  const pipboy_tests = require('./pipboy.test.json')
9
+ const instance = require('./pipboy.instance.json')
9
10
 
10
11
  // start/stop listening
11
12
  class API {
@@ -501,11 +502,36 @@ addWeapon('pistol')
501
502
  addWeapon('rifle')
502
503
  */
503
504
 
505
+ const template = {
506
+ configs: [
507
+ "pistols rifles grenades mines and shotguns are weapons",
508
+ "mines and grenades are explosives",
509
+ "explosives are weapons",
510
+ "pistols rifles and shotguns are firearms",
511
+ "firearms are weapons",
512
+ "hats armor and suits are clothes",
513
+ // "a rifle is a weapon",
514
+ //"a weapon is equipable and changeable"
515
+ "a weapon is equipable",
516
+ "clothes are wearable",
517
+ // "weapons are countable", TODO fix this
518
+ "edible is a concept",
519
+ "food is edible",
520
+ "drinks are drinkable",
521
+ "meat is food",
522
+ "vegetables and fruit are food",
523
+ "cola and pop are drinks",
524
+ "medicine and stimpaks are takeable",
525
+ "item modifies properties",
526
+ "damage luck hp rads value ap charisma range and accuracy are item properties",
527
+ configStruct,
528
+ ]
529
+ }
530
+
504
531
  const createConfig = () => {
505
- const config = new Config(configStruct, module)
532
+ const config = new Config({ name: 'pipboy' }, module)
506
533
  config.stop_auto_rebuild()
507
- //console.log('base_km.config.hierarchy', JSON.stringify(base_km.config.hierarchy, null, 2))
508
- config.add(base_km(), countable(), comparable(), help(), math())
534
+ config.add(hierarchy(), countable(), comparable(), help(), math())
509
535
  // console.log('config.config.hierarchy', JSON.stringify(config.config.hierarchy, null, 2))
510
536
  // console.log('config.hierarchy', config.hierarchy)
511
537
  config.api = api
@@ -517,6 +543,7 @@ knowledgeModule({
517
543
  module,
518
544
  description: 'Control a pipboy with speech',
519
545
  createConfig,
546
+ template: { template, instance },
520
547
  test: {
521
548
  name: './pipboy.test.json',
522
549
  contents: pipboy_tests,
@@ -1,5 +1,5 @@
1
1
  {
2
- "queries": [
2
+ "configs": [
3
3
  "pokemon modifies type",
4
4
  "pokemon type is a type",
5
5
  "pikachu squirtle weedle and pidgeot are pokemon",
@@ -324,15 +324,15 @@
324
324
  "dead": true,
325
325
  "modifiers": [
326
326
  {
327
+ "value": "pokemon",
328
+ "unknown": true,
329
+ "text": "pokemon",
327
330
  "marker": "unknown",
331
+ "word": "pokemon",
328
332
  "range": {
329
333
  "start": 0,
330
334
  "end": 6
331
335
  },
332
- "word": "pokemon",
333
- "text": "pokemon",
334
- "value": "pokemon",
335
- "unknown": true,
336
336
  "dead": true,
337
337
  "level": 1
338
338
  }
@@ -1644,54 +1644,54 @@
1644
1644
  "listable": true,
1645
1645
  "value": [
1646
1646
  {
1647
+ "value": "pikachu",
1648
+ "unknown": true,
1649
+ "text": "pikachu",
1647
1650
  "marker": "unknown",
1651
+ "word": "pikachu",
1648
1652
  "range": {
1649
1653
  "start": 0,
1650
1654
  "end": 6
1651
1655
  },
1652
- "word": "pikachu",
1653
- "text": "pikachu",
1654
- "value": "pikachu",
1655
- "unknown": true,
1656
1656
  "dead": true,
1657
1657
  "level": 1
1658
1658
  },
1659
1659
  {
1660
+ "value": "squirtle",
1661
+ "unknown": true,
1662
+ "text": "squirtle",
1660
1663
  "marker": "unknown",
1664
+ "word": "squirtle",
1661
1665
  "range": {
1662
1666
  "start": 8,
1663
1667
  "end": 15
1664
1668
  },
1665
- "word": "squirtle",
1666
- "text": "squirtle",
1667
- "value": "squirtle",
1668
- "unknown": true,
1669
1669
  "dead": true,
1670
1670
  "level": 1
1671
1671
  },
1672
1672
  {
1673
+ "value": "weedle",
1674
+ "unknown": true,
1675
+ "text": "weedle",
1673
1676
  "marker": "unknown",
1677
+ "word": "weedle",
1674
1678
  "range": {
1675
1679
  "start": 17,
1676
1680
  "end": 22
1677
1681
  },
1678
- "word": "weedle",
1679
- "text": "weedle",
1680
- "value": "weedle",
1681
- "unknown": true,
1682
1682
  "dead": true,
1683
1683
  "level": 2
1684
1684
  },
1685
1685
  {
1686
+ "value": "pidgeot",
1687
+ "unknown": true,
1688
+ "text": "pidgeot",
1686
1689
  "marker": "unknown",
1690
+ "word": "pidgeot",
1687
1691
  "range": {
1688
1692
  "start": 28,
1689
1693
  "end": 34
1690
1694
  },
1691
- "word": "pidgeot",
1692
- "text": "pidgeot",
1693
- "value": "pidgeot",
1694
- "unknown": true,
1695
1695
  "dead": true,
1696
1696
  "level": 2
1697
1697
  }
@@ -1842,16 +1842,6 @@
1842
1842
  "unknown",
1843
1843
  1
1844
1844
  ]
1845
- ],
1846
- [
1847
- [
1848
- "pokemon",
1849
- 0
1850
- ],
1851
- [
1852
- "unknown",
1853
- 0
1854
- ]
1855
1845
  ]
1856
1846
  ],
1857
1847
  "learned_contextual_priorities": [],
@@ -2413,15 +2403,15 @@
2413
2403
  "dead": true,
2414
2404
  "modifiers": [
2415
2405
  {
2406
+ "value": "fire",
2407
+ "unknown": true,
2408
+ "text": "fire",
2416
2409
  "marker": "unknown",
2410
+ "word": "fire",
2417
2411
  "range": {
2418
2412
  "start": 0,
2419
2413
  "end": 3
2420
2414
  },
2421
- "word": "fire",
2422
- "text": "fire",
2423
- "value": "fire",
2424
- "unknown": true,
2425
2415
  "dead": true,
2426
2416
  "level": 1
2427
2417
  }
@@ -3128,15 +3118,15 @@
3128
3118
  "dead": true,
3129
3119
  "modifiers": [
3130
3120
  {
3121
+ "value": "water",
3122
+ "unknown": true,
3123
+ "text": "water",
3131
3124
  "marker": "unknown",
3125
+ "word": "water",
3132
3126
  "range": {
3133
3127
  "start": 0,
3134
3128
  "end": 4
3135
3129
  },
3136
- "word": "water",
3137
- "text": "water",
3138
- "value": "water",
3139
- "unknown": true,
3140
3130
  "dead": true,
3141
3131
  "level": 1
3142
3132
  }
@@ -3915,15 +3905,15 @@
3915
3905
  "dead": true,
3916
3906
  "modifiers": [
3917
3907
  {
3908
+ "value": "earth",
3909
+ "unknown": true,
3910
+ "text": "earth",
3918
3911
  "marker": "unknown",
3912
+ "word": "earth",
3919
3913
  "range": {
3920
3914
  "start": 0,
3921
3915
  "end": 4
3922
3916
  },
3923
- "word": "earth",
3924
- "text": "earth",
3925
- "value": "earth",
3926
- "unknown": true,
3927
3917
  "dead": true,
3928
3918
  "level": 1
3929
3919
  }
@@ -4774,15 +4764,15 @@
4774
4764
  "dead": true,
4775
4765
  "modifiers": [
4776
4766
  {
4767
+ "value": "electric",
4768
+ "unknown": true,
4769
+ "text": "electric",
4777
4770
  "marker": "unknown",
4771
+ "word": "electric",
4778
4772
  "range": {
4779
4773
  "start": 0,
4780
4774
  "end": 7
4781
4775
  },
4782
- "word": "electric",
4783
- "text": "electric",
4784
- "value": "electric",
4785
- "unknown": true,
4786
4776
  "dead": true,
4787
4777
  "level": 1
4788
4778
  }
@@ -10158,24 +10148,6 @@
10158
10148
  "is",
10159
10149
  0
10160
10150
  ]
10161
- ],
10162
- [
10163
- [
10164
- "electric",
10165
- 0
10166
- ],
10167
- [
10168
- "is",
10169
- 0
10170
- ],
10171
- [
10172
- "pikachu",
10173
- 0
10174
- ],
10175
- [
10176
- "type",
10177
- 0
10178
- ]
10179
10151
  ]
10180
10152
  ],
10181
10153
  "learned_contextual_priorities": [],
@@ -11097,15 +11069,15 @@
11097
11069
  },
11098
11070
  "one": {
11099
11071
  "number": "one",
11072
+ "value": "charmander",
11073
+ "unknown": true,
11074
+ "text": "charmander",
11100
11075
  "marker": "unknown",
11076
+ "word": "charmander",
11101
11077
  "range": {
11102
11078
  "start": 0,
11103
11079
  "end": 24
11104
11080
  },
11105
- "word": "charmander",
11106
- "text": "charmander",
11107
- "value": "charmander",
11108
- "unknown": true,
11109
11081
  "dead": true,
11110
11082
  "types": [
11111
11083
  "unknown"
@@ -11611,24 +11583,6 @@
11611
11583
  1
11612
11584
  ]
11613
11585
  ],
11614
- [
11615
- [
11616
- "electric",
11617
- 0
11618
- ],
11619
- [
11620
- "is",
11621
- 0
11622
- ],
11623
- [
11624
- "pikachu",
11625
- 0
11626
- ],
11627
- [
11628
- "type",
11629
- 0
11630
- ]
11631
- ],
11632
11586
  [
11633
11587
  [
11634
11588
  "is",
@@ -11928,16 +11882,6 @@
11928
11882
  "unknown",
11929
11883
  1
11930
11884
  ]
11931
- ],
11932
- [
11933
- [
11934
- "pokemon",
11935
- 0
11936
- ],
11937
- [
11938
- "unknown",
11939
- 0
11940
- ]
11941
11885
  ]
11942
11886
  ],
11943
11887
  "learned_contextual_priorities": []
package/common/pokemon.js CHANGED
@@ -6,7 +6,7 @@ const pokemon_instance = require('./pokemon.instance.json')
6
6
  const pluralize = require('pluralize')
7
7
 
8
8
  const template = {
9
- queries: [
9
+ configs: [
10
10
  "pokemon modifies type",
11
11
  "pokemon type is a type",
12
12
  "pikachu squirtle weedle and pidgeot are pokemon",
@@ -1,5 +1,5 @@
1
1
  {
2
- "queries": [
2
+ "configs": [
3
3
  "pressure is a dimension",
4
4
  "pascals and atmospheres are units of pressure",
5
5
  "pascals = atmospheres * 101325",
@@ -192,6 +192,10 @@
192
192
  "convertToUnits",
193
193
  "queryable"
194
194
  ],
195
+ [
196
+ "convertToUnits",
197
+ "testingValue"
198
+ ],
195
199
  [
196
200
  "countable",
197
201
  "hierarchyAble"
@@ -344,6 +348,10 @@
344
348
  "it",
345
349
  "toAble"
346
350
  ],
351
+ [
352
+ "length",
353
+ "dimension"
354
+ ],
347
355
  [
348
356
  "lowest",
349
357
  "condition"
@@ -572,6 +580,10 @@
572
580
  "reason",
573
581
  "theAble"
574
582
  ],
583
+ [
584
+ "testingValue",
585
+ "testingValue"
586
+ ],
575
587
  [
576
588
  "that",
577
589
  "thisitthat"
@@ -815,15 +827,15 @@
815
827
  },
816
828
  "one": {
817
829
  "number": "one",
830
+ "value": "pressure",
831
+ "unknown": true,
832
+ "text": "pressure",
818
833
  "marker": "unknown",
834
+ "word": "pressure",
819
835
  "range": {
820
836
  "start": 0,
821
837
  "end": 22
822
838
  },
823
- "word": "pressure",
824
- "text": "pressure",
825
- "value": "pressure",
826
- "unknown": true,
827
839
  "dead": true,
828
840
  "types": [
829
841
  "unknown"
@@ -1136,6 +1148,10 @@
1136
1148
  "convertToUnits",
1137
1149
  "queryable"
1138
1150
  ],
1151
+ [
1152
+ "convertToUnits",
1153
+ "testingValue"
1154
+ ],
1139
1155
  [
1140
1156
  "countable",
1141
1157
  "hierarchyAble"
@@ -1288,6 +1304,10 @@
1288
1304
  "it",
1289
1305
  "toAble"
1290
1306
  ],
1307
+ [
1308
+ "length",
1309
+ "dimension"
1310
+ ],
1291
1311
  [
1292
1312
  "lowest",
1293
1313
  "condition"
@@ -1548,6 +1568,10 @@
1548
1568
  "reason",
1549
1569
  "theAble"
1550
1570
  ],
1571
+ [
1572
+ "testingValue",
1573
+ "testingValue"
1574
+ ],
1551
1575
  [
1552
1576
  "that",
1553
1577
  "thisitthat"
@@ -1940,28 +1964,28 @@
1940
1964
  "listable": true,
1941
1965
  "value": [
1942
1966
  {
1967
+ "value": "pascals",
1968
+ "unknown": true,
1969
+ "text": "pascals",
1943
1970
  "marker": "unknown",
1971
+ "word": "pascals",
1944
1972
  "range": {
1945
1973
  "start": 0,
1946
1974
  "end": 6
1947
1975
  },
1948
- "word": "pascals",
1949
- "text": "pascals",
1950
- "value": "pascals",
1951
- "unknown": true,
1952
1976
  "dead": true,
1953
1977
  "level": 2
1954
1978
  },
1955
1979
  {
1980
+ "value": "atmospheres",
1981
+ "unknown": true,
1982
+ "text": "atmospheres",
1956
1983
  "marker": "unknown",
1984
+ "word": "atmospheres",
1957
1985
  "range": {
1958
1986
  "start": 12,
1959
1987
  "end": 22
1960
1988
  },
1961
- "word": "atmospheres",
1962
- "text": "atmospheres",
1963
- "value": "atmospheres",
1964
- "unknown": true,
1965
1989
  "dead": true,
1966
1990
  "level": 2
1967
1991
  }
@@ -2223,16 +2247,6 @@
2223
2247
  "propertyOf",
2224
2248
  1
2225
2249
  ]
2226
- ],
2227
- [
2228
- [
2229
- "pressure",
2230
- 0
2231
- ],
2232
- [
2233
- "unknown",
2234
- 0
2235
- ]
2236
2250
  ]
2237
2251
  ],
2238
2252
  "learned_contextual_priorities": [],
@@ -2459,6 +2473,10 @@
2459
2473
  "convertToUnits",
2460
2474
  "queryable"
2461
2475
  ],
2476
+ [
2477
+ "convertToUnits",
2478
+ "testingValue"
2479
+ ],
2462
2480
  [
2463
2481
  "countable",
2464
2482
  "hierarchyAble"
@@ -2611,6 +2629,10 @@
2611
2629
  "it",
2612
2630
  "toAble"
2613
2631
  ],
2632
+ [
2633
+ "length",
2634
+ "dimension"
2635
+ ],
2614
2636
  [
2615
2637
  "lowest",
2616
2638
  "condition"
@@ -2903,6 +2925,10 @@
2903
2925
  "reason",
2904
2926
  "theAble"
2905
2927
  ],
2928
+ [
2929
+ "testingValue",
2930
+ "testingValue"
2931
+ ],
2906
2932
  [
2907
2933
  "that",
2908
2934
  "thisitthat"
@@ -3538,6 +3564,10 @@
3538
3564
  "convertToUnits",
3539
3565
  "queryable"
3540
3566
  ],
3567
+ [
3568
+ "convertToUnits",
3569
+ "testingValue"
3570
+ ],
3541
3571
  [
3542
3572
  "countable",
3543
3573
  "hierarchyAble"
@@ -3690,6 +3720,10 @@
3690
3720
  "it",
3691
3721
  "toAble"
3692
3722
  ],
3723
+ [
3724
+ "length",
3725
+ "dimension"
3726
+ ],
3693
3727
  [
3694
3728
  "lowest",
3695
3729
  "condition"
@@ -3982,6 +4016,10 @@
3982
4016
  "reason",
3983
4017
  "theAble"
3984
4018
  ],
4019
+ [
4020
+ "testingValue",
4021
+ "testingValue"
4022
+ ],
3985
4023
  [
3986
4024
  "that",
3987
4025
  "thisitthat"
@@ -4750,16 +4788,6 @@
4750
4788
  "unknown",
4751
4789
  1
4752
4790
  ]
4753
- ],
4754
- [
4755
- [
4756
- "pressure",
4757
- 0
4758
- ],
4759
- [
4760
- "unknown",
4761
- 0
4762
- ]
4763
4791
  ]
4764
4792
  ],
4765
4793
  "learned_contextual_priorities": []
@@ -5,7 +5,7 @@ const pressure_tests = require('./pressure.test.json')
5
5
  const pressure_instance = require('./pressure.instance.json')
6
6
 
7
7
  const template = {
8
- "queries": [
8
+ configs: [
9
9
  "pressure is a dimension",
10
10
  "pascals and atmospheres are units of pressure",
11
11