ekms 7.12.8-beta.0 → 7.12.8-beta.1

Sign up to get free protection for your applications and to get access to all the features.
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
+ queries: [
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,
@@ -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"
@@ -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"
@@ -2459,6 +2483,10 @@
2459
2483
  "convertToUnits",
2460
2484
  "queryable"
2461
2485
  ],
2486
+ [
2487
+ "convertToUnits",
2488
+ "testingValue"
2489
+ ],
2462
2490
  [
2463
2491
  "countable",
2464
2492
  "hierarchyAble"
@@ -2611,6 +2639,10 @@
2611
2639
  "it",
2612
2640
  "toAble"
2613
2641
  ],
2642
+ [
2643
+ "length",
2644
+ "dimension"
2645
+ ],
2614
2646
  [
2615
2647
  "lowest",
2616
2648
  "condition"
@@ -2903,6 +2935,10 @@
2903
2935
  "reason",
2904
2936
  "theAble"
2905
2937
  ],
2938
+ [
2939
+ "testingValue",
2940
+ "testingValue"
2941
+ ],
2906
2942
  [
2907
2943
  "that",
2908
2944
  "thisitthat"
@@ -3538,6 +3574,10 @@
3538
3574
  "convertToUnits",
3539
3575
  "queryable"
3540
3576
  ],
3577
+ [
3578
+ "convertToUnits",
3579
+ "testingValue"
3580
+ ],
3541
3581
  [
3542
3582
  "countable",
3543
3583
  "hierarchyAble"
@@ -3690,6 +3730,10 @@
3690
3730
  "it",
3691
3731
  "toAble"
3692
3732
  ],
3733
+ [
3734
+ "length",
3735
+ "dimension"
3736
+ ],
3693
3737
  [
3694
3738
  "lowest",
3695
3739
  "condition"
@@ -3982,6 +4026,10 @@
3982
4026
  "reason",
3983
4027
  "theAble"
3984
4028
  ],
4029
+ [
4030
+ "testingValue",
4031
+ "testingValue"
4032
+ ],
3985
4033
  [
3986
4034
  "that",
3987
4035
  "thisitthat"
@@ -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"
@@ -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
  "temperature",
1549
1569
  "theAble"
1550
1570
  ],
1571
+ [
1572
+ "testingValue",
1573
+ "testingValue"
1574
+ ],
1551
1575
  [
1552
1576
  "that",
1553
1577
  "thisitthat"
@@ -2572,6 +2596,10 @@
2572
2596
  "convertToUnits",
2573
2597
  "queryable"
2574
2598
  ],
2599
+ [
2600
+ "convertToUnits",
2601
+ "testingValue"
2602
+ ],
2575
2603
  [
2576
2604
  "countable",
2577
2605
  "hierarchyAble"
@@ -2788,6 +2816,10 @@
2788
2816
  "kelvin",
2789
2817
  "unit"
2790
2818
  ],
2819
+ [
2820
+ "length",
2821
+ "dimension"
2822
+ ],
2791
2823
  [
2792
2824
  "lowest",
2793
2825
  "condition"
@@ -3048,6 +3080,10 @@
3048
3080
  "temperature",
3049
3081
  "theAble"
3050
3082
  ],
3083
+ [
3084
+ "testingValue",
3085
+ "testingValue"
3086
+ ],
3051
3087
  [
3052
3088
  "that",
3053
3089
  "thisitthat"
@@ -3987,6 +4023,10 @@
3987
4023
  "convertToUnits",
3988
4024
  "queryable"
3989
4025
  ],
4026
+ [
4027
+ "convertToUnits",
4028
+ "testingValue"
4029
+ ],
3990
4030
  [
3991
4031
  "countable",
3992
4032
  "hierarchyAble"
@@ -4203,6 +4243,10 @@
4203
4243
  "kelvin",
4204
4244
  "unit"
4205
4245
  ],
4246
+ [
4247
+ "length",
4248
+ "dimension"
4249
+ ],
4206
4250
  [
4207
4251
  "lowest",
4208
4252
  "condition"
@@ -4463,6 +4507,10 @@
4463
4507
  "temperature",
4464
4508
  "theAble"
4465
4509
  ],
4510
+ [
4511
+ "testingValue",
4512
+ "testingValue"
4513
+ ],
4466
4514
  [
4467
4515
  "that",
4468
4516
  "thisitthat"
@@ -200,6 +200,10 @@
200
200
  "convertToUnits",
201
201
  "queryable"
202
202
  ],
203
+ [
204
+ "convertToUnits",
205
+ "testingValue"
206
+ ],
203
207
  [
204
208
  "countable",
205
209
  "hierarchyAble"
@@ -352,6 +356,10 @@
352
356
  "it",
353
357
  "toAble"
354
358
  ],
359
+ [
360
+ "length",
361
+ "dimension"
362
+ ],
355
363
  [
356
364
  "lowest",
357
365
  "condition"
@@ -580,6 +588,10 @@
580
588
  "reason",
581
589
  "theAble"
582
590
  ],
591
+ [
592
+ "testingValue",
593
+ "testingValue"
594
+ ],
583
595
  [
584
596
  "that",
585
597
  "thisitthat"
@@ -1059,6 +1071,10 @@
1059
1071
  "convertToUnits",
1060
1072
  "queryable"
1061
1073
  ],
1074
+ [
1075
+ "convertToUnits",
1076
+ "testingValue"
1077
+ ],
1062
1078
  [
1063
1079
  "countable",
1064
1080
  "hierarchyAble"
@@ -1211,6 +1227,10 @@
1211
1227
  "it",
1212
1228
  "toAble"
1213
1229
  ],
1230
+ [
1231
+ "length",
1232
+ "dimension"
1233
+ ],
1214
1234
  [
1215
1235
  "lowest",
1216
1236
  "condition"
@@ -1475,6 +1495,10 @@
1475
1495
  "reason",
1476
1496
  "theAble"
1477
1497
  ],
1498
+ [
1499
+ "testingValue",
1500
+ "testingValue"
1501
+ ],
1478
1502
  [
1479
1503
  "that",
1480
1504
  "thisitthat"
@@ -2111,6 +2135,10 @@
2111
2135
  "convertToUnits",
2112
2136
  "queryable"
2113
2137
  ],
2138
+ [
2139
+ "convertToUnits",
2140
+ "testingValue"
2141
+ ],
2114
2142
  [
2115
2143
  "countable",
2116
2144
  "hierarchyAble"
@@ -2263,6 +2291,10 @@
2263
2291
  "it",
2264
2292
  "toAble"
2265
2293
  ],
2294
+ [
2295
+ "length",
2296
+ "dimension"
2297
+ ],
2266
2298
  [
2267
2299
  "lowest",
2268
2300
  "condition"
@@ -2527,6 +2559,10 @@
2527
2559
  "reason",
2528
2560
  "theAble"
2529
2561
  ],
2562
+ [
2563
+ "testingValue",
2564
+ "testingValue"
2565
+ ],
2530
2566
  [
2531
2567
  "that",
2532
2568
  "thisitthat"
@@ -4069,6 +4105,10 @@
4069
4105
  "convertToUnits",
4070
4106
  "queryable"
4071
4107
  ],
4108
+ [
4109
+ "convertToUnits",
4110
+ "testingValue"
4111
+ ],
4072
4112
  [
4073
4113
  "countable",
4074
4114
  "hierarchyAble"
@@ -4285,6 +4325,10 @@
4285
4325
  "kilogram",
4286
4326
  "unit"
4287
4327
  ],
4328
+ [
4329
+ "length",
4330
+ "dimension"
4331
+ ],
4288
4332
  [
4289
4333
  "lowest",
4290
4334
  "condition"
@@ -4585,6 +4629,10 @@
4585
4629
  "reason",
4586
4630
  "theAble"
4587
4631
  ],
4632
+ [
4633
+ "testingValue",
4634
+ "testingValue"
4635
+ ],
4588
4636
  [
4589
4637
  "that",
4590
4638
  "thisitthat"
@@ -5369,6 +5417,10 @@
5369
5417
  "convertToUnits",
5370
5418
  "queryable"
5371
5419
  ],
5420
+ [
5421
+ "convertToUnits",
5422
+ "testingValue"
5423
+ ],
5372
5424
  [
5373
5425
  "countable",
5374
5426
  "hierarchyAble"
@@ -5585,6 +5637,10 @@
5585
5637
  "kilogram",
5586
5638
  "unit"
5587
5639
  ],
5640
+ [
5641
+ "length",
5642
+ "dimension"
5643
+ ],
5588
5644
  [
5589
5645
  "lowest",
5590
5646
  "condition"
@@ -5885,6 +5941,10 @@
5885
5941
  "reason",
5886
5942
  "theAble"
5887
5943
  ],
5944
+ [
5945
+ "testingValue",
5946
+ "testingValue"
5947
+ ],
5888
5948
  [
5889
5949
  "that",
5890
5950
  "thisitthat"
@@ -6661,6 +6721,10 @@
6661
6721
  "convertToUnits",
6662
6722
  "queryable"
6663
6723
  ],
6724
+ [
6725
+ "convertToUnits",
6726
+ "testingValue"
6727
+ ],
6664
6728
  [
6665
6729
  "countable",
6666
6730
  "hierarchyAble"
@@ -6877,6 +6941,10 @@
6877
6941
  "kilogram",
6878
6942
  "unit"
6879
6943
  ],
6944
+ [
6945
+ "length",
6946
+ "dimension"
6947
+ ],
6880
6948
  [
6881
6949
  "lowest",
6882
6950
  "condition"
@@ -7177,6 +7245,10 @@
7177
7245
  "reason",
7178
7246
  "theAble"
7179
7247
  ],
7248
+ [
7249
+ "testingValue",
7250
+ "testingValue"
7251
+ ],
7180
7252
  [
7181
7253
  "that",
7182
7254
  "thisitthat"
@@ -7920,6 +7992,10 @@
7920
7992
  "convertToUnits",
7921
7993
  "queryable"
7922
7994
  ],
7995
+ [
7996
+ "convertToUnits",
7997
+ "testingValue"
7998
+ ],
7923
7999
  [
7924
8000
  "countable",
7925
8001
  "hierarchyAble"
@@ -8136,6 +8212,10 @@
8136
8212
  "kilogram",
8137
8213
  "unit"
8138
8214
  ],
8215
+ [
8216
+ "length",
8217
+ "dimension"
8218
+ ],
8139
8219
  [
8140
8220
  "lowest",
8141
8221
  "condition"
@@ -8436,6 +8516,10 @@
8436
8516
  "reason",
8437
8517
  "theAble"
8438
8518
  ],
8519
+ [
8520
+ "testingValue",
8521
+ "testingValue"
8522
+ ],
8439
8523
  [
8440
8524
  "that",
8441
8525
  "thisitthat"
@@ -9179,6 +9263,10 @@
9179
9263
  "convertToUnits",
9180
9264
  "queryable"
9181
9265
  ],
9266
+ [
9267
+ "convertToUnits",
9268
+ "testingValue"
9269
+ ],
9182
9270
  [
9183
9271
  "countable",
9184
9272
  "hierarchyAble"
@@ -9395,6 +9483,10 @@
9395
9483
  "kilogram",
9396
9484
  "unit"
9397
9485
  ],
9486
+ [
9487
+ "length",
9488
+ "dimension"
9489
+ ],
9398
9490
  [
9399
9491
  "lowest",
9400
9492
  "condition"
@@ -9695,6 +9787,10 @@
9695
9787
  "reason",
9696
9788
  "theAble"
9697
9789
  ],
9790
+ [
9791
+ "testingValue",
9792
+ "testingValue"
9793
+ ],
9698
9794
  [
9699
9795
  "that",
9700
9796
  "thisitthat"
@@ -10438,6 +10534,10 @@
10438
10534
  "convertToUnits",
10439
10535
  "queryable"
10440
10536
  ],
10537
+ [
10538
+ "convertToUnits",
10539
+ "testingValue"
10540
+ ],
10441
10541
  [
10442
10542
  "countable",
10443
10543
  "hierarchyAble"
@@ -10654,6 +10754,10 @@
10654
10754
  "kilogram",
10655
10755
  "unit"
10656
10756
  ],
10757
+ [
10758
+ "length",
10759
+ "dimension"
10760
+ ],
10657
10761
  [
10658
10762
  "lowest",
10659
10763
  "condition"
@@ -10954,6 +11058,10 @@
10954
11058
  "reason",
10955
11059
  "theAble"
10956
11060
  ],
11061
+ [
11062
+ "testingValue",
11063
+ "testingValue"
11064
+ ],
10957
11065
  [
10958
11066
  "that",
10959
11067
  "thisitthat"
@@ -11697,6 +11805,10 @@
11697
11805
  "convertToUnits",
11698
11806
  "queryable"
11699
11807
  ],
11808
+ [
11809
+ "convertToUnits",
11810
+ "testingValue"
11811
+ ],
11700
11812
  [
11701
11813
  "countable",
11702
11814
  "hierarchyAble"
@@ -11913,6 +12025,10 @@
11913
12025
  "kilogram",
11914
12026
  "unit"
11915
12027
  ],
12028
+ [
12029
+ "length",
12030
+ "dimension"
12031
+ ],
11916
12032
  [
11917
12033
  "lowest",
11918
12034
  "condition"
@@ -12213,6 +12329,10 @@
12213
12329
  "reason",
12214
12330
  "theAble"
12215
12331
  ],
12332
+ [
12333
+ "testingValue",
12334
+ "testingValue"
12335
+ ],
12216
12336
  [
12217
12337
  "that",
12218
12338
  "thisitthat"
@@ -12956,6 +13076,10 @@
12956
13076
  "convertToUnits",
12957
13077
  "queryable"
12958
13078
  ],
13079
+ [
13080
+ "convertToUnits",
13081
+ "testingValue"
13082
+ ],
12959
13083
  [
12960
13084
  "countable",
12961
13085
  "hierarchyAble"
@@ -13172,6 +13296,10 @@
13172
13296
  "kilogram",
13173
13297
  "unit"
13174
13298
  ],
13299
+ [
13300
+ "length",
13301
+ "dimension"
13302
+ ],
13175
13303
  [
13176
13304
  "lowest",
13177
13305
  "condition"
@@ -13472,6 +13600,10 @@
13472
13600
  "reason",
13473
13601
  "theAble"
13474
13602
  ],
13603
+ [
13604
+ "testingValue",
13605
+ "testingValue"
13606
+ ],
13475
13607
  [
13476
13608
  "that",
13477
13609
  "thisitthat"
@@ -14241,6 +14373,10 @@
14241
14373
  "convertToUnits",
14242
14374
  "queryable"
14243
14375
  ],
14376
+ [
14377
+ "convertToUnits",
14378
+ "testingValue"
14379
+ ],
14244
14380
  [
14245
14381
  "countable",
14246
14382
  "hierarchyAble"
@@ -14457,6 +14593,10 @@
14457
14593
  "kilogram",
14458
14594
  "unit"
14459
14595
  ],
14596
+ [
14597
+ "length",
14598
+ "dimension"
14599
+ ],
14460
14600
  [
14461
14601
  "lowest",
14462
14602
  "condition"
@@ -14757,6 +14897,10 @@
14757
14897
  "reason",
14758
14898
  "theAble"
14759
14899
  ],
14900
+ [
14901
+ "testingValue",
14902
+ "testingValue"
14903
+ ],
14760
14904
  [
14761
14905
  "that",
14762
14906
  "thisitthat"
package/main.js CHANGED
@@ -14,9 +14,6 @@ const ordering = require('./common/ordering')
14
14
  const properties = require('./common/properties')
15
15
  const sizeable = require('./common/sizeable')
16
16
  const yesno = require('./common/yesno')
17
- const dimensionTemplate = require('./common/dimensionTemplate')
18
- const formulasTemplate = require('./common/formulasTemplate')
19
- const pipboyTemplate = require('./common/pipboyTemplate')
20
17
  const dialogues = require('./common/dialogues')
21
18
  const gdefaults = require('./common/gdefaults')
22
19
  const meta = require('./common/meta')
@@ -62,9 +59,6 @@ ordering,
62
59
  properties,
63
60
  sizeable,
64
61
  yesno,
65
- dimensionTemplate,
66
- formulasTemplate,
67
- pipboyTemplate,
68
62
  dialogues,
69
63
  gdefaults,
70
64
  meta,