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
@@ -6,10 +6,10 @@
6
6
  "operators": [
7
7
  "([mathematicalExpression])",
8
8
  "([mathematical_operator])",
9
- "(([number|]) [plusOperator] ([number|]))",
10
- "(([number|]) [minusOperator] ([number|]))",
11
- "(([number|]) [timesOperator] ([number|]))",
12
- "(([number|]) [divideByOperator|] ([number|]))",
9
+ "((number/* || mathematicalExpression/*) [plusOperator] (number/* || mathematicalExpression/*))",
10
+ "((number/* || mathematicalExpression/*) [minusOperator] (number/* || mathematicalExpression/*))",
11
+ "((number/* || mathematicalExpression/*) [timesOperator] (number/* || mathematicalExpression/*))",
12
+ "((number/* || mathematicalExpression/*) [divideByOperator|] (number/* || mathematicalExpression/*))",
13
13
  "([plusExpression|])",
14
14
  "([minusExpression|])",
15
15
  "([timesExpression|])",
@@ -27,8 +27,7 @@
27
27
  {
28
28
  "id": "mathematicalExpression",
29
29
  "isA": [
30
- "concept",
31
- "number"
30
+ "concept"
32
31
  ]
33
32
  },
34
33
  {
@@ -1359,10 +1358,10 @@
1359
1358
  "operators": [
1360
1359
  "([mathematicalExpression])",
1361
1360
  "([mathematical_operator])",
1362
- "(([number|]) [plusOperator] ([number|]))",
1363
- "(([number|]) [minusOperator] ([number|]))",
1364
- "(([number|]) [timesOperator] ([number|]))",
1365
- "(([number|]) [divideByOperator|] ([number|]))",
1361
+ "((number/* || mathematicalExpression/*) [plusOperator] (number/* || mathematicalExpression/*))",
1362
+ "((number/* || mathematicalExpression/*) [minusOperator] (number/* || mathematicalExpression/*))",
1363
+ "((number/* || mathematicalExpression/*) [timesOperator] (number/* || mathematicalExpression/*))",
1364
+ "((number/* || mathematicalExpression/*) [divideByOperator|] (number/* || mathematicalExpression/*))",
1366
1365
  "([plusExpression|])",
1367
1366
  "([minusExpression|])",
1368
1367
  "([timesExpression|])",
@@ -1380,8 +1379,7 @@
1380
1379
  {
1381
1380
  "id": "mathematicalExpression",
1382
1381
  "isA": [
1383
- "concept",
1384
- "number"
1382
+ "concept"
1385
1383
  ]
1386
1384
  },
1387
1385
  {
package/common/math.js CHANGED
@@ -76,10 +76,10 @@ const config = {
76
76
  operators: [
77
77
  "([mathematicalExpression])",
78
78
  "([mathematical_operator])",
79
- "(([number|]) [plusOperator] ([number|]))",
80
- "(([number|]) [minusOperator] ([number|]))",
81
- "(([number|]) [timesOperator] ([number|]))",
82
- "(([number|]) [divideByOperator|] ([number|]))",
79
+ "((number/* || mathematicalExpression/*) [plusOperator] (number/* || mathematicalExpression/*))",
80
+ "((number/* || mathematicalExpression/*) [minusOperator] (number/* || mathematicalExpression/*))",
81
+ "((number/* || mathematicalExpression/*) [timesOperator] (number/* || mathematicalExpression/*))",
82
+ "((number/* || mathematicalExpression/*) [divideByOperator|] (number/* || mathematicalExpression/*))",
83
83
  "([plusExpression|])",
84
84
  "([minusExpression|])",
85
85
  "([timesExpression|])",
@@ -91,7 +91,8 @@ const config = {
91
91
  {
92
92
  id: "mathematicalExpression",
93
93
  // isA: ['queryable', 'theAble'],
94
- isA: ['concept', 'number'],
94
+ //isA: ['concept', 'number'],
95
+ isA: ['concept'],
95
96
  },
96
97
  {
97
98
  id: "mathematical_operator",
@@ -517,11 +517,6 @@
517
517
  "concept",
518
518
  false
519
519
  ],
520
- [
521
- "mathematicalExpression",
522
- "number",
523
- false
524
- ],
525
520
  [
526
521
  "mathematical_operator",
527
522
  "adjective",
@@ -1856,11 +1851,6 @@
1856
1851
  "concept",
1857
1852
  false
1858
1853
  ],
1859
- [
1860
- "mathematicalExpression",
1861
- "number",
1862
- false
1863
- ],
1864
1854
  [
1865
1855
  "mathematical_operator",
1866
1856
  "adjective",
@@ -3379,11 +3369,6 @@
3379
3369
  "concept",
3380
3370
  false
3381
3371
  ],
3382
- [
3383
- "mathematicalExpression",
3384
- "number",
3385
- false
3386
- ],
3387
3372
  [
3388
3373
  "mathematical_operator",
3389
3374
  "adjective",
@@ -4992,11 +4977,6 @@
4992
4977
  "concept",
4993
4978
  false
4994
4979
  ],
4995
- [
4996
- "mathematicalExpression",
4997
- "number",
4998
- false
4999
- ],
5000
4980
  [
5001
4981
  "mathematical_operator",
5002
4982
  "adjective",
@@ -6521,11 +6501,6 @@
6521
6501
  "concept",
6522
6502
  false
6523
6503
  ],
6524
- [
6525
- "mathematicalExpression",
6526
- "number",
6527
- false
6528
- ],
6529
6504
  [
6530
6505
  "mathematical_operator",
6531
6506
  "adjective",
@@ -8508,11 +8483,6 @@
8508
8483
  "concept",
8509
8484
  false
8510
8485
  ],
8511
- [
8512
- "mathematicalExpression",
8513
- "number",
8514
- false
8515
- ],
8516
8486
  [
8517
8487
  "mathematical_operator",
8518
8488
  "adjective",
@@ -9959,11 +9929,6 @@
9959
9929
  "concept",
9960
9930
  false
9961
9931
  ],
9962
- [
9963
- "mathematicalExpression",
9964
- "number",
9965
- false
9966
- ],
9967
9932
  [
9968
9933
  "mathematical_operator",
9969
9934
  "adjective",
package/common/meta.js CHANGED
@@ -254,7 +254,7 @@ const config = {
254
254
  valuesPrime.push(valuePrime)
255
255
  }
256
256
  }
257
- response = { marker: 'list', truthValue: valuesPrime.length > 0, value: unflatten(valuesPrime, context.flatten || []) }
257
+ response = { marker: 'list', listable: true, truthValue: valuesPrime.length > 0, value: unflatten(valuesPrime, context.flatten || []) }
258
258
  } else {
259
259
  const toPrime = toPrimes[0][0]
260
260
  response = toPrime.evalue
@@ -19,12 +19,12 @@ class API {
19
19
  context.namespaced.nameable ??= {}
20
20
  context.namespaced.nameable.names ??= []
21
21
  context.namespaced.nameable.names.push(name)
22
- this.args.config.addWord(name, { id: context.marker, initial: `{ value: "${name}", pullFromContext: true, nameable_named: true }` })
22
+ this.args.config.addWord(name, { id: context.marker, initial: `{ value: "${name}", pullFromContext: true, nameable_named: true, instance: ${context.instance ? 'true' : 'false'} }` })
23
23
  }
24
24
 
25
25
  // used by mongo km
26
26
  get(type, name) {
27
- return this.args.kms.stm.api.mentions({
27
+ return this.args.kms.stm.api.recall({
28
28
  context: type,
29
29
  condition: (context) => {
30
30
  if (context.namespaced?.nameable && context.namespaced.nameable.names) {
@@ -54,16 +54,16 @@ class API {
54
54
  setCurrent(name) {
55
55
  const context = this.objects.named[name]
56
56
  if (context) {
57
- this.args.km('stm').api.mentioned({ context })
57
+ this.args.km('stm').api.remember({ context })
58
58
  }
59
59
  }
60
60
  }
61
61
 
62
62
  function initializer({config}) {
63
- config.addArgs(({kms, mentioned}) => {
63
+ config.addArgs(({kms, remember}) => {
64
64
  return {
65
- mentioned: (args) => {
66
- mentioned(args)
65
+ remember: (args) => {
66
+ remember(args)
67
67
  if (args.name) {
68
68
  kms.nameable.api.setName(args.context, args.name)
69
69
  }
@@ -124,8 +124,6 @@ const config = {
124
124
  `,
125
125
  // generatorp: async ({context, g, gs}) => `call ${await g(context.nameable)} ${await gs(context.name)}`,
126
126
  semantic: async ({config, context, api, e, verbatim, g}) => {
127
- // TODO find report being referred to
128
- // debugger
129
127
  const nameable = (await e(context.nameable))?.evalue
130
128
  if (!nameable) {
131
129
  verbatim(`${await g(context.nameable)} is not known`)
@@ -158,7 +156,7 @@ const config = {
158
156
  semantics: [
159
157
  {
160
158
  where: where(),
161
- match: ({context}) => context.marker == 'mentions' && context.evaluate && context.args.context.nameable_named,
159
+ match: ({context}) => context.marker == 'mentions' && context.evaluate && context.args?.context?.nameable_named,
162
160
  apply: async ({callId, _continue, toList, context, kms, e, log, retry}) => {
163
161
  context.args.condition ??= () => true
164
162
  const oldCondition = context.args.condition
@@ -34,11 +34,45 @@ const config = {
34
34
  semantics: [
35
35
  {
36
36
  where: where(),
37
- match: ({context}) => context.marker == 'mentions' && context.evaluate,
38
- apply: async ({callId, _continue, toList, context, kms, e, log, retry}) => {
39
- if (context.args?.context?.ordinal?.marker == 'ordinal' && context.args?.context?.ordinal?.value == -1) {
40
- const lastN = context.args.context.quantity?.value || 1
41
- context.args.lastN = lastN
37
+ match: ({context}) => context.marker == 'mentions' && context.evaluate && context.args?.context?.ordinal,
38
+ apply: async ({callId, _continue, toList, context, kms, e, log, toArray, retry}) => {
39
+ // const ordinals = toArray(context.args?.context?.ordinal)
40
+ const lastNotFirst = context.args?.context?.ordinal.value < 0
41
+ const quantity = context.args.context.quantity?.value || 1
42
+ context.args.filter ??= (r) => r
43
+ context.args.all = true
44
+ const oldFilter = context.args.filter
45
+ context.args.filter = (result) => {
46
+ const reversed = context.args.frameOfReference?.namespaced?.stm?.reversed
47
+ let selected = []
48
+ for (const ordinal of toArray(context.args?.context?.ordinal)) {
49
+ if (context.args.context.quantity) {
50
+ if (lastNotFirst) {
51
+ if (reversed) {
52
+ selected = selected.concat(result.slice(-quantity))
53
+ } else {
54
+ selected = selected.concat(result.slice(0, quantity).reverse())
55
+ }
56
+ } else {
57
+ if (!reversed) {
58
+ selected = selected.concat(result.slice(-quantity).reverse())
59
+ } else {
60
+ selected = selected.concat(result.slice(0, quantity))
61
+ }
62
+ }
63
+ } else {
64
+ let point
65
+ if (ordinal.value > 0) {
66
+ point = result[ordinal.value-1]
67
+ } else {
68
+ point = result[result.length + ordinal.value]
69
+ }
70
+ if (point) {
71
+ selected.push(point)
72
+ }
73
+ }
74
+ }
75
+ return oldFilter(selected)
42
76
  }
43
77
  _continue()
44
78
  }
@@ -53,6 +87,18 @@ const config = {
53
87
  "2nd": [{"id": "ordinal", "initial": "{ value: 2, ordinal: true, instance: true }" }],
54
88
  "third": [{"id": "ordinal", "initial": "{ value: 3, ordinal: true, instance: true }" }],
55
89
  "3rd": [{"id": "ordinal", "initial": "{ value: 3, ordinal: true, instance: true }" }],
90
+ "fourth": [{"id": "ordinal", "initial": "{ value: 4, ordinal: true, instance: true }" }],
91
+ "4rd": [{"id": "ordinal", "initial": "{ value: 4, ordinal: true, instance: true }" }],
92
+ "fifth": [{"id": "ordinal", "initial": "{ value: 5, ordinal: true, instance: true }" }],
93
+ "5th": [{"id": "ordinal", "initial": "{ value: 5, ordinal: true, instance: true }" }],
94
+ "sixth": [{"id": "ordinal", "initial": "{ value: 6, ordinal: true, instance: true }" }],
95
+ "6th": [{"id": "ordinal", "initial": "{ value: 6, ordinal: true, instance: true }" }],
96
+ "seventh": [{"id": "ordinal", "initial": "{ value: 7, ordinal: true, instance: true }" }],
97
+ "7th": [{"id": "ordinal", "initial": "{ value: 7, ordinal: true, instance: true }" }],
98
+ "eigth": [{"id": "ordinal", "initial": "{ value: 8, ordinal: true, instance: true }" }],
99
+ "8th": [{"id": "ordinal", "initial": "{ value: 8, ordinal: true, instance: true }" }],
100
+ "ninth": [{"id": "ordinal", "initial": "{ value: 9, ordinal: true, instance: true }" }],
101
+ "9th": [{"id": "ordinal", "initial": "{ value: 9, ordinal: true, instance: true }" }],
56
102
  },
57
103
  patterns: [
58
104
  { "pattern": [{ type: 'digit' }, { repeat: true }, 'th'], defs: [{id: "ordinal", uuid: '1', initial: "{ value: int(substr(text, -2)), ordinal: true, instance: true }" }]},
@@ -907,11 +907,6 @@
907
907
  "concept",
908
908
  false
909
909
  ],
910
- [
911
- "mathematicalExpression",
912
- "number",
913
- false
914
- ],
915
910
  [
916
911
  "mathematical_operator",
917
912
  "adjective",
@@ -3337,11 +3332,6 @@
3337
3332
  "concept",
3338
3333
  false
3339
3334
  ],
3340
- [
3341
- "mathematicalExpression",
3342
- "number",
3343
- false
3344
- ],
3345
3335
  [
3346
3336
  "mathematical_operator",
3347
3337
  "adjective",
@@ -5212,11 +5202,6 @@
5212
5202
  "concept",
5213
5203
  false
5214
5204
  ],
5215
- [
5216
- "mathematicalExpression",
5217
- "number",
5218
- false
5219
- ],
5220
5205
  [
5221
5206
  "mathematical_operator",
5222
5207
  "adjective",
@@ -6913,11 +6898,6 @@
6913
6898
  "concept",
6914
6899
  false
6915
6900
  ],
6916
- [
6917
- "mathematicalExpression",
6918
- "number",
6919
- false
6920
- ],
6921
6901
  [
6922
6902
  "mathematical_operator",
6923
6903
  "adjective",
@@ -9064,11 +9044,6 @@
9064
9044
  "concept",
9065
9045
  false
9066
9046
  ],
9067
- [
9068
- "mathematicalExpression",
9069
- "number",
9070
- false
9071
- ],
9072
9047
  [
9073
9048
  "mathematical_operator",
9074
9049
  "adjective",
@@ -10825,11 +10800,6 @@
10825
10800
  "concept",
10826
10801
  false
10827
10802
  ],
10828
- [
10829
- "mathematicalExpression",
10830
- "number",
10831
- false
10832
- ],
10833
10803
  [
10834
10804
  "mathematical_operator",
10835
10805
  "adjective",
@@ -13186,11 +13156,6 @@
13186
13156
  "concept",
13187
13157
  false
13188
13158
  ],
13189
- [
13190
- "mathematicalExpression",
13191
- "number",
13192
- false
13193
- ],
13194
13159
  [
13195
13160
  "mathematical_operator",
13196
13161
  "adjective",
@@ -15288,11 +15253,6 @@
15288
15253
  "concept",
15289
15254
  false
15290
15255
  ],
15291
- [
15292
- "mathematicalExpression",
15293
- "number",
15294
- false
15295
- ],
15296
15256
  [
15297
15257
  "mathematical_operator",
15298
15258
  "adjective",
@@ -17274,11 +17234,6 @@
17274
17234
  "concept",
17275
17235
  false
17276
17236
  ],
17277
- [
17278
- "mathematicalExpression",
17279
- "number",
17280
- false
17281
- ],
17282
17237
  [
17283
17238
  "mathematical_operator",
17284
17239
  "adjective",
@@ -19402,11 +19357,6 @@
19402
19357
  "concept",
19403
19358
  false
19404
19359
  ],
19405
- [
19406
- "mathematicalExpression",
19407
- "number",
19408
- false
19409
- ],
19410
19360
  [
19411
19361
  "mathematical_operator",
19412
19362
  "adjective",
@@ -21519,11 +21469,6 @@
21519
21469
  "concept",
21520
21470
  false
21521
21471
  ],
21522
- [
21523
- "mathematicalExpression",
21524
- "number",
21525
- false
21526
- ],
21527
21472
  [
21528
21473
  "mathematical_operator",
21529
21474
  "adjective",
@@ -23717,11 +23662,6 @@
23717
23662
  "concept",
23718
23663
  false
23719
23664
  ],
23720
- [
23721
- "mathematicalExpression",
23722
- "number",
23723
- false
23724
- ],
23725
23665
  [
23726
23666
  "mathematical_operator",
23727
23667
  "adjective",
@@ -25919,11 +25859,6 @@
25919
25859
  "concept",
25920
25860
  false
25921
25861
  ],
25922
- [
25923
- "mathematicalExpression",
25924
- "number",
25925
- false
25926
- ],
25927
25862
  [
25928
25863
  "mathematical_operator",
25929
25864
  "adjective",
@@ -28448,11 +28383,6 @@
28448
28383
  "concept",
28449
28384
  false
28450
28385
  ],
28451
- [
28452
- "mathematicalExpression",
28453
- "number",
28454
- false
28455
- ],
28456
28386
  [
28457
28387
  "mathematical_operator",
28458
28388
  "adjective",
@@ -31067,11 +30997,6 @@
31067
30997
  "concept",
31068
30998
  false
31069
30999
  ],
31070
- [
31071
- "mathematicalExpression",
31072
- "number",
31073
- false
31074
- ],
31075
31000
  [
31076
31001
  "mathematical_operator",
31077
31002
  "adjective",
@@ -33747,11 +33672,6 @@
33747
33672
  "concept",
33748
33673
  false
33749
33674
  ],
33750
- [
33751
- "mathematicalExpression",
33752
- "number",
33753
- false
33754
- ],
33755
33675
  [
33756
33676
  "mathematical_operator",
33757
33677
  "adjective",
@@ -36300,11 +36220,6 @@
36300
36220
  "concept",
36301
36221
  false
36302
36222
  ],
36303
- [
36304
- "mathematicalExpression",
36305
- "number",
36306
- false
36307
- ],
36308
36223
  [
36309
36224
  "mathematical_operator",
36310
36225
  "adjective",
package/common/pipboy.js CHANGED
@@ -417,7 +417,7 @@ const config = {
417
417
  generatorp: ({context, g}) => `${context.marker} ${g(context.type)}`,
418
418
  isA: ['verby'],
419
419
  semantic: ({context, kms}) => {
420
- kms.dialogues.api.mentioned({
420
+ kms.dialogues.api.remember({
421
421
  marker: context.type.marker,
422
422
  value: context.type.marker
423
423
  })