ekms 9.6.3-beta.2 → 9.6.3-beta.21

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 (55) hide show
  1. package/common/actions.instance.json +130 -5
  2. package/common/actions.js +54 -4
  3. package/common/actions.test.json +31359 -322
  4. package/common/angle.instance.json +58 -834
  5. package/common/articles.js +1 -2
  6. package/common/compass.instance.json +3 -18
  7. package/common/concept.js +2 -1
  8. package/common/conjunction.js +11 -17
  9. package/common/dialogues.js +3 -3
  10. package/common/dimension.instance.json +4 -69
  11. package/common/dimension.js +5 -5
  12. package/common/drone.instance.json +14985 -2538
  13. package/common/drone.js +276 -61
  14. package/common/drone.test.json +412474 -28440
  15. package/common/drone_v1.instance.json +324 -44
  16. package/common/drone_v1.js +9 -9
  17. package/common/edible.instance.json +72 -0
  18. package/common/fastfood.instance.json +5 -72
  19. package/common/fastfood.js +1 -1
  20. package/common/formulas.instance.json +0 -5
  21. package/common/formulas.js +1 -1
  22. package/common/gdefaults.js +16 -5
  23. package/common/helpers/conjunction.js +2 -0
  24. package/common/helpers/formulas.js +6 -0
  25. package/common/helpers/properties.js +9 -7
  26. package/common/helpers.js +9 -5
  27. package/common/hierarchy.js +2 -0
  28. package/common/length.instance.json +555 -5686
  29. package/common/math.instance.json +10 -12
  30. package/common/math.js +6 -5
  31. package/common/menus.instance.json +0 -35
  32. package/common/meta.js +1 -1
  33. package/common/nameable.js +7 -9
  34. package/common/ordinals.js +51 -5
  35. package/common/pipboy.instance.json +0 -85
  36. package/common/pipboy.js +1 -1
  37. package/common/pressure.instance.json +28 -370
  38. package/common/properties.js +4 -3
  39. package/common/rates.instance.json +1 -1
  40. package/common/rates.js +3 -3
  41. package/common/reminders.js +1 -1
  42. package/common/reports.instance.json +9 -176
  43. package/common/reports.js +2 -2
  44. package/common/scorekeeper.js +1 -1
  45. package/common/sdefaults.js +40 -5
  46. package/common/stm.js +50 -42
  47. package/common/temperature.instance.json +648 -2303
  48. package/common/time.instance.json +7376 -1965
  49. package/common/time.js +22 -1
  50. package/common/time.test.json +13239 -0
  51. package/common/ui.instance.json +0 -5
  52. package/common/ui.js +1 -1
  53. package/common/weight.instance.json +329 -1834
  54. package/common/wp.instance.json +88 -70
  55. package/package.json +3 -3
@@ -783,11 +783,6 @@
783
783
  "expression",
784
784
  false
785
785
  ],
786
- [
787
- "mathematicalExpression",
788
- "number",
789
- false
790
- ],
791
786
  [
792
787
  "mathematical_operator",
793
788
  "adjective",
@@ -1765,7 +1760,7 @@
1765
1760
  ],
1766
1761
  [
1767
1762
  "unit",
1768
- "number",
1763
+ "mathematicalExpression",
1769
1764
  false
1770
1765
  ],
1771
1766
  [
@@ -2980,11 +2975,6 @@
2980
2975
  "expression",
2981
2976
  false
2982
2977
  ],
2983
- [
2984
- "mathematicalExpression",
2985
- "number",
2986
- false
2987
- ],
2988
2978
  [
2989
2979
  "mathematical_operator",
2990
2980
  "adjective",
@@ -4007,7 +3997,7 @@
4007
3997
  ],
4008
3998
  [
4009
3999
  "unit",
4010
- "number",
4000
+ "mathematicalExpression",
4011
4001
  false
4012
4002
  ],
4013
4003
  [
@@ -5778,11 +5768,6 @@
5778
5768
  "expression",
5779
5769
  false
5780
5770
  ],
5781
- [
5782
- "mathematicalExpression",
5783
- "number",
5784
- false
5785
- ],
5786
5771
  [
5787
5772
  "mathematical_operator",
5788
5773
  "adjective",
@@ -6850,7 +6835,7 @@
6850
6835
  ],
6851
6836
  [
6852
6837
  "unit",
6853
- "number",
6838
+ "mathematicalExpression",
6854
6839
  false
6855
6840
  ],
6856
6841
  [
@@ -7037,7 +7022,7 @@
7037
7022
  },
7038
7023
  {
7039
7024
  "op": [
7040
- "integer",
7025
+ "timesOperator",
7041
7026
  0
7042
7027
  ],
7043
7028
  "ops": [
@@ -7056,23 +7041,6 @@
7056
7041
  ],
7057
7042
  "counter": 3
7058
7043
  },
7059
- {
7060
- "op": [
7061
- "timesOperator",
7062
- 0
7063
- ],
7064
- "ops": [
7065
- [
7066
- "equals",
7067
- 0
7068
- ],
7069
- [
7070
- "timesOperator",
7071
- 0
7072
- ]
7073
- ],
7074
- "counter": 4
7075
- },
7076
7044
  {
7077
7045
  "op": [
7078
7046
  "equals",
@@ -7084,7 +7052,7 @@
7084
7052
  0
7085
7053
  ]
7086
7054
  ],
7087
- "counter": 5
7055
+ "counter": 4
7088
7056
  }
7089
7057
  ]
7090
7058
  },
@@ -7139,7 +7107,10 @@
7139
7107
  "level": 0
7140
7108
  },
7141
7109
  "types": [
7142
- "number",
7110
+ "expression",
7111
+ "listable",
7112
+ "queryable",
7113
+ "theAble",
7143
7114
  "timesExpression"
7144
7115
  ],
7145
7116
  "x": {
@@ -7160,8 +7131,8 @@
7160
7131
  "level": 0
7161
7132
  },
7162
7133
  "y": {
7163
- "instance": true,
7164
7134
  "value": 101325,
7135
+ "instance": true,
7165
7136
  "text": "101325",
7166
7137
  "marker": "integer",
7167
7138
  "word": "101325",
@@ -7169,11 +7140,10 @@
7169
7140
  "start": 24,
7170
7141
  "end": 29
7171
7142
  },
7172
- "dead": true,
7173
7143
  "types": [
7174
7144
  "integer"
7175
7145
  ],
7176
- "level": 1
7146
+ "level": 0
7177
7147
  },
7178
7148
  "number": "one",
7179
7149
  "isResponse": true,
@@ -7234,24 +7204,6 @@
7234
7204
  0
7235
7205
  ]
7236
7206
  ],
7237
- [
7238
- [
7239
- "atmosphere",
7240
- 0
7241
- ],
7242
- [
7243
- "equals",
7244
- 0
7245
- ],
7246
- [
7247
- "pascal",
7248
- 0
7249
- ],
7250
- [
7251
- "timesOperator",
7252
- 0
7253
- ]
7254
- ],
7255
7207
  [
7256
7208
  [
7257
7209
  "equals",
@@ -7431,61 +7383,6 @@
7431
7383
  ],
7432
7384
  "counter": 3
7433
7385
  },
7434
- {
7435
- "operators": [
7436
- {
7437
- "marker": [
7438
- "pascal",
7439
- 0
7440
- ],
7441
- "range": {
7442
- "start": 0,
7443
- "end": 6
7444
- }
7445
- },
7446
- {
7447
- "marker": [
7448
- "equals",
7449
- 0
7450
- ],
7451
- "range": {
7452
- "start": 8,
7453
- "end": 8
7454
- }
7455
- },
7456
- {
7457
- "marker": [
7458
- "atmosphere",
7459
- 0
7460
- ],
7461
- "range": {
7462
- "start": 10,
7463
- "end": 20
7464
- }
7465
- },
7466
- {
7467
- "marker": [
7468
- "timesOperator",
7469
- 0
7470
- ],
7471
- "range": {
7472
- "start": 22,
7473
- "end": 22
7474
- }
7475
- },
7476
- {
7477
- "marker": [
7478
- "integer",
7479
- 1
7480
- ],
7481
- "range": {
7482
- "start": 24,
7483
- "end": 29
7484
- }
7485
- }
7486
- ],
7487
- "counter": 4
7488
- },
7489
7386
  {
7490
7387
  "operators": [
7491
7388
  {
@@ -7519,7 +7416,7 @@
7519
7416
  }
7520
7417
  }
7521
7418
  ],
7522
- "counter": 5
7419
+ "counter": 4
7523
7420
  },
7524
7421
  {
7525
7422
  "operators": [
@@ -7534,7 +7431,7 @@
7534
7431
  }
7535
7432
  }
7536
7433
  ],
7537
- "counter": 6
7434
+ "counter": 5
7538
7435
  }
7539
7436
  ],
7540
7437
  "length": 1
@@ -8369,11 +8266,6 @@
8369
8266
  "expression",
8370
8267
  false
8371
8268
  ],
8372
- [
8373
- "mathematicalExpression",
8374
- "number",
8375
- false
8376
- ],
8377
8269
  [
8378
8270
  "mathematical_operator",
8379
8271
  "adjective",
@@ -9441,7 +9333,7 @@
9441
9333
  ],
9442
9334
  [
9443
9335
  "unit",
9444
- "number",
9336
+ "mathematicalExpression",
9445
9337
  false
9446
9338
  ],
9447
9339
  [
@@ -9628,7 +9520,7 @@
9628
9520
  },
9629
9521
  {
9630
9522
  "op": [
9631
- "integer",
9523
+ "divideByOperator",
9632
9524
  0
9633
9525
  ],
9634
9526
  "ops": [
@@ -9647,23 +9539,6 @@
9647
9539
  ],
9648
9540
  "counter": 3
9649
9541
  },
9650
- {
9651
- "op": [
9652
- "divideByOperator",
9653
- 0
9654
- ],
9655
- "ops": [
9656
- [
9657
- "divideByOperator",
9658
- 0
9659
- ],
9660
- [
9661
- "equals",
9662
- 0
9663
- ]
9664
- ],
9665
- "counter": 4
9666
- },
9667
9542
  {
9668
9543
  "op": [
9669
9544
  "equals",
@@ -9675,7 +9550,7 @@
9675
9550
  0
9676
9551
  ]
9677
9552
  ],
9678
- "counter": 5
9553
+ "counter": 4
9679
9554
  }
9680
9555
  ]
9681
9556
  },
@@ -9731,7 +9606,10 @@
9731
9606
  },
9732
9607
  "types": [
9733
9608
  "divideByExpression",
9734
- "number"
9609
+ "expression",
9610
+ "listable",
9611
+ "queryable",
9612
+ "theAble"
9735
9613
  ],
9736
9614
  "x": {
9737
9615
  "value": "pascal",
@@ -9751,8 +9629,8 @@
9751
9629
  "level": 0
9752
9630
  },
9753
9631
  "y": {
9754
- "instance": true,
9755
9632
  "value": 101325,
9633
+ "instance": true,
9756
9634
  "text": "101325",
9757
9635
  "marker": "integer",
9758
9636
  "word": "101325",
@@ -9760,11 +9638,10 @@
9760
9638
  "start": 24,
9761
9639
  "end": 29
9762
9640
  },
9763
- "dead": true,
9764
9641
  "types": [
9765
9642
  "integer"
9766
9643
  ],
9767
- "level": 1
9644
+ "level": 0
9768
9645
  },
9769
9646
  "number": "one",
9770
9647
  "isResponse": true,
@@ -9825,24 +9702,6 @@
9825
9702
  0
9826
9703
  ]
9827
9704
  ],
9828
- [
9829
- [
9830
- "atmosphere",
9831
- 0
9832
- ],
9833
- [
9834
- "divideByOperator",
9835
- 0
9836
- ],
9837
- [
9838
- "equals",
9839
- 0
9840
- ],
9841
- [
9842
- "pascal",
9843
- 0
9844
- ]
9845
- ],
9846
9705
  [
9847
9706
  [
9848
9707
  "atmosphere",
@@ -10022,61 +9881,6 @@
10022
9881
  ],
10023
9882
  "counter": 3
10024
9883
  },
10025
- {
10026
- "operators": [
10027
- {
10028
- "marker": [
10029
- "atmosphere",
10030
- 0
10031
- ],
10032
- "range": {
10033
- "start": 0,
10034
- "end": 10
10035
- }
10036
- },
10037
- {
10038
- "marker": [
10039
- "equals",
10040
- 0
10041
- ],
10042
- "range": {
10043
- "start": 12,
10044
- "end": 12
10045
- }
10046
- },
10047
- {
10048
- "marker": [
10049
- "pascal",
10050
- 0
10051
- ],
10052
- "range": {
10053
- "start": 14,
10054
- "end": 20
10055
- }
10056
- },
10057
- {
10058
- "marker": [
10059
- "divideByOperator",
10060
- 0
10061
- ],
10062
- "range": {
10063
- "start": 22,
10064
- "end": 22
10065
- }
10066
- },
10067
- {
10068
- "marker": [
10069
- "integer",
10070
- 1
10071
- ],
10072
- "range": {
10073
- "start": 24,
10074
- "end": 29
10075
- }
10076
- }
10077
- ],
10078
- "counter": 4
10079
- },
10080
9884
  {
10081
9885
  "operators": [
10082
9886
  {
@@ -10110,7 +9914,7 @@
10110
9914
  }
10111
9915
  }
10112
9916
  ],
10113
- "counter": 5
9917
+ "counter": 4
10114
9918
  },
10115
9919
  {
10116
9920
  "operators": [
@@ -10125,7 +9929,7 @@
10125
9929
  }
10126
9930
  }
10127
9931
  ],
10128
- "counter": 6
9932
+ "counter": 5
10129
9933
  }
10130
9934
  ],
10131
9935
  "length": 1
@@ -10182,24 +9986,6 @@
10182
9986
  0
10183
9987
  ]
10184
9988
  ],
10185
- [
10186
- [
10187
- "atmosphere",
10188
- 0
10189
- ],
10190
- [
10191
- "divideByOperator",
10192
- 0
10193
- ],
10194
- [
10195
- "equals",
10196
- 0
10197
- ],
10198
- [
10199
- "pascal",
10200
- 0
10201
- ]
10202
- ],
10203
9989
  [
10204
9990
  [
10205
9991
  "atmosphere",
@@ -10232,24 +10018,6 @@
10232
10018
  0
10233
10019
  ]
10234
10020
  ],
10235
- [
10236
- [
10237
- "atmosphere",
10238
- 0
10239
- ],
10240
- [
10241
- "equals",
10242
- 0
10243
- ],
10244
- [
10245
- "pascal",
10246
- 0
10247
- ],
10248
- [
10249
- "timesOperator",
10250
- 0
10251
- ]
10252
- ],
10253
10021
  [
10254
10022
  [
10255
10023
  "dimension",
@@ -11133,61 +10901,6 @@
11133
10901
  ],
11134
10902
  "counter": 3
11135
10903
  },
11136
- {
11137
- "operators": [
11138
- {
11139
- "marker": [
11140
- "pascal",
11141
- 0
11142
- ],
11143
- "range": {
11144
- "start": 0,
11145
- "end": 6
11146
- }
11147
- },
11148
- {
11149
- "marker": [
11150
- "equals",
11151
- 0
11152
- ],
11153
- "range": {
11154
- "start": 8,
11155
- "end": 8
11156
- }
11157
- },
11158
- {
11159
- "marker": [
11160
- "atmosphere",
11161
- 0
11162
- ],
11163
- "range": {
11164
- "start": 10,
11165
- "end": 20
11166
- }
11167
- },
11168
- {
11169
- "marker": [
11170
- "timesOperator",
11171
- 0
11172
- ],
11173
- "range": {
11174
- "start": 22,
11175
- "end": 22
11176
- }
11177
- },
11178
- {
11179
- "marker": [
11180
- "integer",
11181
- 1
11182
- ],
11183
- "range": {
11184
- "start": 24,
11185
- "end": 29
11186
- }
11187
- }
11188
- ],
11189
- "counter": 4
11190
- },
11191
10904
  {
11192
10905
  "operators": [
11193
10906
  {
@@ -11221,7 +10934,7 @@
11221
10934
  }
11222
10935
  }
11223
10936
  ],
11224
- "counter": 5
10937
+ "counter": 4
11225
10938
  },
11226
10939
  {
11227
10940
  "operators": [
@@ -11236,7 +10949,7 @@
11236
10949
  }
11237
10950
  }
11238
10951
  ],
11239
- "counter": 6
10952
+ "counter": 5
11240
10953
  }
11241
10954
  ],
11242
10955
  "length": 1
@@ -11408,61 +11121,6 @@
11408
11121
  ],
11409
11122
  "counter": 3
11410
11123
  },
11411
- {
11412
- "operators": [
11413
- {
11414
- "marker": [
11415
- "atmosphere",
11416
- 0
11417
- ],
11418
- "range": {
11419
- "start": 0,
11420
- "end": 10
11421
- }
11422
- },
11423
- {
11424
- "marker": [
11425
- "equals",
11426
- 0
11427
- ],
11428
- "range": {
11429
- "start": 12,
11430
- "end": 12
11431
- }
11432
- },
11433
- {
11434
- "marker": [
11435
- "pascal",
11436
- 0
11437
- ],
11438
- "range": {
11439
- "start": 14,
11440
- "end": 20
11441
- }
11442
- },
11443
- {
11444
- "marker": [
11445
- "divideByOperator",
11446
- 0
11447
- ],
11448
- "range": {
11449
- "start": 22,
11450
- "end": 22
11451
- }
11452
- },
11453
- {
11454
- "marker": [
11455
- "integer",
11456
- 1
11457
- ],
11458
- "range": {
11459
- "start": 24,
11460
- "end": 29
11461
- }
11462
- }
11463
- ],
11464
- "counter": 4
11465
- },
11466
11124
  {
11467
11125
  "operators": [
11468
11126
  {
@@ -11496,7 +11154,7 @@
11496
11154
  }
11497
11155
  }
11498
11156
  ],
11499
- "counter": 5
11157
+ "counter": 4
11500
11158
  },
11501
11159
  {
11502
11160
  "operators": [
@@ -11511,7 +11169,7 @@
11511
11169
  }
11512
11170
  }
11513
11171
  ],
11514
- "counter": 6
11172
+ "counter": 5
11515
11173
  }
11516
11174
  ],
11517
11175
  "length": 1
@@ -485,6 +485,7 @@ const config = {
485
485
  !(context.types || []).includes('property') &&
486
486
  // !context.value && // greghere
487
487
  !context.ordinal &&
488
+ (!context.objects || context.objects.length !== 2 || !context.objects[1].instance) &&
488
489
  (api.objects && api.objects.children && api.objects.children[context.marker]) &&
489
490
  !context.evaluate.toConcept,
490
491
  apply: ({context, objects, api, km}) => {
@@ -494,6 +495,7 @@ const config = {
494
495
  context.hierarchy = true
495
496
  context.evalue = {
496
497
  marker: 'list',
498
+ listable: true,
497
499
  // value: api.objects.children[context.marker]
498
500
  value: phrases,
499
501
  }
@@ -625,9 +627,8 @@ const config = {
625
627
  !context.evaluate.toConcept, // && !context.value,
626
628
  // greghere
627
629
  // match: ({context, hierarchy}) => hierarchy.isA(context.marker, 'property') && context.evaluate,
628
- apply: async ({callId, context, api, kms, objects, g, s, log, mentions}) => {
630
+ apply: async ({callId, context, api, kms, objects, g, s, log, recall}) => {
629
631
  const toDo = [ ...context.objects ]
630
-
631
632
  async function toValue(objectContext) {
632
633
  if (!objectContext.value) {
633
634
  return objectContext;
@@ -666,7 +667,7 @@ const config = {
666
667
 
667
668
  let fromMentions
668
669
  if (!await api.knownProperty(currentContext, nextContext)) {
669
- fromMentions = await mentions({ context: nextContext, frameOfReference: currentContext })
670
+ fromMentions = await recall({ context: nextContext, all: nextContext.number == 'many', frameOfReference: currentContext })
670
671
  if (!fromMentions) {
671
672
  context.verbatim = `There is no property ${await g({...nextContext, paraphrase: true})} of ${await g({...currentContext, paraphrase: true})}`
672
673
  return
@@ -20,7 +20,7 @@
20
20
  "semantics": [
21
21
  {
22
22
  "match": "({context}) => context.marker == 'convertToUnits' && context.evaluate && (context.from?.unit?.marker == 'unitPerUnit' || context.to.marker == 'unitPerUnit')",
23
- "apply": "async ({mentioned, context, kms, e, callId, resolveEvaluate, toEValue, error}) => {\n\n async function convert(fromUnits, fromAmount, toUnits) {\n let evalue;\n if (toUnits.value == fromUnits.value) {\n evalue = fromAmount\n // if (!fromAmount.value) {\n // debugger\n //}\n evalue.evalue = fromAmount.evalue || fromAmount.value\n } else {\n const formula = kms.formulas.api.get(toUnits, [fromUnits])\n if (!formula) {\n const reason = { marker: 'reason', focusableForPhrase: true, evalue: { marker: 'noconversion', from: fromUnits, to: toUnits } }\n kms.stm.api.mentioned({ context: reason })\n error(reason)\n }\n kms.stm.api.setVariable(fromUnits.value, fromAmount)\n evalue = await e(formula)\n }\n return evalue\n }\n\n if (!context.from.unit) {\n resolveEvaluate(context.from, await e(context.from))\n }\n\n\n const from = toEValue(context.from)\n mentioned(context.to)\n const evalueNumerator = await convert(from.unit.numerator, from.amount, context.to.numerator)\n const evalueDenominator = await convert(from.unit.denominator, 1, context.to.denominator)\n const evalue = { evalue: (toFinalValue(evalueNumerator) || evalueNumerator.value) / (toFinalValue(evalueDenominator) || evalueDenominator.evalue) }\n context.evalue = {\n paraphrase: true,\n marker: 'quantity',\n level: 1,\n unit: context.to,\n amount: { evalue, paraphrase: undefined }\n }\n }"
23
+ "apply": "async ({remember, context, kms, e, callId, resolveEvaluate, toEValue, error}) => {\n\n async function convert(fromUnits, fromAmount, toUnits) {\n let evalue;\n if (toUnits.value == fromUnits.value) {\n evalue = fromAmount\n // if (!fromAmount.value) {\n // debugger\n //}\n evalue.evalue = fromAmount.evalue || fromAmount.value\n } else {\n const formula = kms.formulas.api.get(toUnits, [fromUnits])\n if (!formula) {\n const reason = { marker: 'reason', focusableForPhrase: true, evalue: { marker: 'noconversion', from: fromUnits, to: toUnits } }\n kms.stm.api.remember({ context: reason })\n error(reason)\n }\n kms.stm.api.setVariable(fromUnits.value, fromAmount)\n evalue = await e(formula)\n }\n return evalue\n }\n\n if (!context.from.unit) {\n resolveEvaluate(context.from, await e(context.from))\n }\n\n\n const from = toEValue(context.from)\n remember(context.to)\n const evalueNumerator = await convert(from.unit.numerator, from.amount, context.to.numerator)\n const evalueDenominator = await convert(from.unit.denominator, 1, context.to.denominator)\n const evalue = { evalue: (toFinalValue(evalueNumerator) || evalueNumerator.value) / (toFinalValue(evalueDenominator) || evalueDenominator.evalue) }\n context.evalue = {\n paraphrase: true,\n marker: 'quantity',\n level: 1,\n unit: context.to,\n amount: { evalue, paraphrase: undefined }\n }\n }"
24
24
  }
25
25
  ]
26
26
  }