ekms 9.6.1 → 9.6.2

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 (37) hide show
  1. package/common/actions.instance.json +99 -0
  2. package/common/actions.js +67 -0
  3. package/common/actions.test.json +656 -0
  4. package/common/angle.instance.json +20 -0
  5. package/common/colors.instance.json +0 -28
  6. package/common/compass.instance.json +15 -0
  7. package/common/dates.instance.json +0 -84
  8. package/common/dialogues.js +1 -1
  9. package/common/dimension.instance.json +96 -12
  10. package/common/dimension.js +12 -3
  11. package/common/drone.instance.json +10130 -1641
  12. package/common/drone.js +217 -71
  13. package/common/drone.test.json +192134 -3455
  14. package/common/drone_v1.instance.json +38 -31
  15. package/common/drone_v1.js +20 -15
  16. package/common/drone_v1.test.json +659 -389
  17. package/common/edible.instance.json +0 -128
  18. package/common/fastfood.instance.json +72 -392
  19. package/common/gdefaults.js +5 -1
  20. package/common/helpers/conjunction.js +9 -5
  21. package/common/helpers/drone.js +13 -1
  22. package/common/length.instance.json +135 -0
  23. package/common/nameable.js +63 -24
  24. package/common/nameable.test.json +3270 -3912
  25. package/common/ordinals.js +13 -0
  26. package/common/pipboy.instance.json +0 -56
  27. package/common/pressure.instance.json +20 -0
  28. package/common/properties.js +16 -6
  29. package/common/reports.instance.json +1 -1
  30. package/common/stm.js +119 -25
  31. package/common/temperature.instance.json +20 -0
  32. package/common/time.instance.json +45 -0
  33. package/common/time.test.json +3403 -0
  34. package/common/weight.instance.json +60 -0
  35. package/common/wp.instance.json +0 -56
  36. package/main.js +2 -0
  37. package/package.json +6 -2
@@ -3661,20 +3661,6 @@
3661
3661
  0
3662
3662
  ]
3663
3663
  ],
3664
- [
3665
- [
3666
- "is",
3667
- 0
3668
- ],
3669
- [
3670
- "list",
3671
- 1
3672
- ],
3673
- [
3674
- "unknown",
3675
- 0
3676
- ]
3677
- ],
3678
3664
  [
3679
3665
  [
3680
3666
  "is",
@@ -37667,20 +37653,6 @@
37667
37653
  0
37668
37654
  ]
37669
37655
  ],
37670
- [
37671
- [
37672
- "is",
37673
- 0
37674
- ],
37675
- [
37676
- "list",
37677
- 1
37678
- ],
37679
- [
37680
- "unknown",
37681
- 0
37682
- ]
37683
- ],
37684
37656
  [
37685
37657
  [
37686
37658
  "is",
@@ -342,6 +342,11 @@
342
342
  "expression",
343
343
  false
344
344
  ],
345
+ [
346
+ "forQuantity",
347
+ "preposition",
348
+ false
349
+ ],
345
350
  [
346
351
  "forVariable",
347
352
  "preposition",
@@ -2577,6 +2582,11 @@
2577
2582
  "expression",
2578
2583
  false
2579
2584
  ],
2585
+ [
2586
+ "forQuantity",
2587
+ "preposition",
2588
+ false
2589
+ ],
2580
2590
  [
2581
2591
  "forVariable",
2582
2592
  "preposition",
@@ -6170,6 +6180,11 @@
6170
6180
  "expression",
6171
6181
  false
6172
6182
  ],
6183
+ [
6184
+ "forQuantity",
6185
+ "preposition",
6186
+ false
6187
+ ],
6173
6188
  [
6174
6189
  "forVariable",
6175
6190
  "preposition",
@@ -3441,20 +3441,6 @@
3441
3441
  0
3442
3442
  ]
3443
3443
  ],
3444
- [
3445
- [
3446
- "is",
3447
- 0
3448
- ],
3449
- [
3450
- "list",
3451
- 1
3452
- ],
3453
- [
3454
- "unknown",
3455
- 0
3456
- ]
3457
- ],
3458
3444
  [
3459
3445
  [
3460
3446
  "is",
@@ -11890,20 +11876,6 @@
11890
11876
  0
11891
11877
  ]
11892
11878
  ],
11893
- [
11894
- [
11895
- "is",
11896
- 0
11897
- ],
11898
- [
11899
- "list",
11900
- 1
11901
- ],
11902
- [
11903
- "unknown",
11904
- 0
11905
- ]
11906
- ],
11907
11879
  [
11908
11880
  [
11909
11881
  "is",
@@ -16118,20 +16090,6 @@
16118
16090
  0
16119
16091
  ]
16120
16092
  ],
16121
- [
16122
- [
16123
- "is",
16124
- 0
16125
- ],
16126
- [
16127
- "list",
16128
- 1
16129
- ],
16130
- [
16131
- "unknown",
16132
- 0
16133
- ]
16134
- ],
16135
16093
  [
16136
16094
  [
16137
16095
  "is",
@@ -19243,48 +19201,6 @@
19243
19201
  0
19244
19202
  ]
19245
19203
  ],
19246
- [
19247
- [
19248
- "is",
19249
- 0
19250
- ],
19251
- [
19252
- "list",
19253
- 1
19254
- ],
19255
- [
19256
- "unknown",
19257
- 0
19258
- ]
19259
- ],
19260
- [
19261
- [
19262
- "is",
19263
- 0
19264
- ],
19265
- [
19266
- "list",
19267
- 1
19268
- ],
19269
- [
19270
- "unknown",
19271
- 0
19272
- ]
19273
- ],
19274
- [
19275
- [
19276
- "is",
19277
- 0
19278
- ],
19279
- [
19280
- "list",
19281
- 1
19282
- ],
19283
- [
19284
- "unknown",
19285
- 0
19286
- ]
19287
- ],
19288
19204
  [
19289
19205
  [
19290
19206
  "setIdSuffix",
@@ -1,4 +1,4 @@
1
- const { knowledgeModule, where, stableId } = require('./runtime').theprogrammablemind
1
+ const { debug, knowledgeModule, where, stableId } = require('./runtime').theprogrammablemind
2
2
  const meta = require('./meta.js')
3
3
  const gdefaults = require('./gdefaults.js')
4
4
  const sdefaults = require('./sdefaults.js')
@@ -24,6 +24,7 @@
24
24
  "((amount/* || number/*) [amountOfCoordinate|] ([unit]))",
25
25
  "(([amount]) [unit])",
26
26
  "((@<=quantity || context.possession == true) [convertToUnits|in] (unit))",
27
+ "([forQuantity|for] (@<= quantity && !context.unit.dimension == null))",
27
28
  "([useUnits|use] (unit))",
28
29
  "([preferredUnits] (quantity))",
29
30
  {
@@ -63,16 +64,38 @@
63
64
  ],
64
65
  "bridges": [
65
66
  {
66
- "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:192",
67
+ "id": "forQuantity",
68
+ "isA": [
69
+ "preposition"
70
+ ],
71
+ "bridge": "{ ...operator, quantity: after[0], operator: operator, interpolate: [ { property: 'operator' }, { property: 'quantity' } ] }",
72
+ "check": [
73
+ "marker",
74
+ "text",
75
+ "verbatim",
76
+ "value",
77
+ "evalue",
78
+ "isResponse",
79
+ {
80
+ "properties": "modifiers"
81
+ },
82
+ {
83
+ "properties": "postModifiers"
84
+ },
85
+ "quantity"
86
+ ]
87
+ },
88
+ {
89
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:199",
67
90
  "id": "preferredUnits",
68
91
  "isA": [
69
92
  "verb"
70
93
  ],
71
94
  "bridge": "{ ...next(operator), quantity: after[0], operator: operator, interpolate: [{ property: 'operator' }, { property: 'quantity' }] }",
72
- "semantic": "async ({context, e, api, toArray, resolveResponse}) => {\n const preferredUnits = api.getPreferredUnits(context.quantity)\n if (!preferredUnits) {\n return\n }\n const from = context.quantity;\n const value = await e({ marker: 'convertToUnits', from, to: preferredUnits })\n resolveResponse(context, value.evalue)\n }"
95
+ "semantic": "async ({context, e, api, toArray, resolveResponse}) => {\n const preferredUnits = await api.getPreferredUnits(context.quantity)\n if (!preferredUnits) {\n return\n }\n const from = context.quantity;\n const value = await e({ marker: 'convertToUnits', from, to: preferredUnits })\n resolveResponse(context, value.evalue)\n }"
73
96
  },
74
97
  {
75
- "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:207",
98
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:214",
76
99
  "id": "useUnits",
77
100
  "isA": [
78
101
  "verb"
@@ -81,15 +104,31 @@
81
104
  "semantic": "({context, api}) => {\n api.setPreferredUnits(context.units)\n }"
82
105
  },
83
106
  {
84
- "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:216",
107
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:223",
85
108
  "id": "dimension"
86
109
  },
87
110
  {
88
- "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:220",
111
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:227",
89
112
  "id": "quantity",
90
113
  "isA": [
91
114
  "noun"
92
115
  ],
116
+ "check": [
117
+ "marker",
118
+ "text",
119
+ "verbatim",
120
+ "value",
121
+ "evalue",
122
+ "isResponse",
123
+ {
124
+ "properties": "modifiers"
125
+ },
126
+ {
127
+ "properties": "postModifiers"
128
+ },
129
+ "amount",
130
+ "unit"
131
+ ],
93
132
  "generatorp": "[object Object]",
94
133
  "generatorr": "[object Object]"
95
134
  },
@@ -104,10 +143,13 @@
104
143
  {
105
144
  "id": "amountOfCoordinate",
106
145
  "convolution": true,
146
+ "before": [
147
+ "preposition"
148
+ ],
107
149
  "bridge": "{ marker: next(operator('quantity')), dead: true, unit: after[0], amount: before[0] }"
108
150
  },
109
151
  {
110
- "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:248",
152
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:257",
111
153
  "id": "convertToUnits",
112
154
  "bridge": "{ ...next(operator), from: before[0], to: after[0] }",
113
155
  "isA": [
@@ -25446,6 +25488,7 @@
25446
25488
  "((amount/* || number/*) [amountOfCoordinate|] ([unit]))",
25447
25489
  "(([amount]) [unit])",
25448
25490
  "((@<=quantity || context.possession == true) [convertToUnits|in] (unit))",
25491
+ "([forQuantity|for] (@<= quantity && !context.unit.dimension == null))",
25449
25492
  "([useUnits|use] (unit))",
25450
25493
  "([preferredUnits] (quantity))",
25451
25494
  {
@@ -25479,12 +25522,34 @@
25479
25522
  ],
25480
25523
  "generators": [
25481
25524
  {
25482
- "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:185"
25525
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:186"
25483
25526
  }
25484
25527
  ],
25485
25528
  "bridges": [
25486
25529
  {
25487
- "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:192",
25530
+ "id": "forQuantity",
25531
+ "isA": [
25532
+ "preposition"
25533
+ ],
25534
+ "bridge": "{ ...operator, quantity: after[0], operator: operator, interpolate: [ { property: 'operator' }, { property: 'quantity' } ] }",
25535
+ "check": [
25536
+ "marker",
25537
+ "text",
25538
+ "verbatim",
25539
+ "value",
25540
+ "evalue",
25541
+ "isResponse",
25542
+ {
25543
+ "properties": "modifiers"
25544
+ },
25545
+ {
25546
+ "properties": "postModifiers"
25547
+ },
25548
+ "quantity"
25549
+ ]
25550
+ },
25551
+ {
25552
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:199",
25488
25553
  "id": "preferredUnits",
25489
25554
  "isA": [
25490
25555
  "verb"
@@ -25492,7 +25557,7 @@
25492
25557
  "bridge": "{ ...next(operator), quantity: after[0], operator: operator, interpolate: [{ property: 'operator' }, { property: 'quantity' }] }"
25493
25558
  },
25494
25559
  {
25495
- "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:207",
25560
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:214",
25496
25561
  "id": "useUnits",
25497
25562
  "isA": [
25498
25563
  "verb"
@@ -25500,15 +25565,31 @@
25500
25565
  "bridge": "{ ...next(operator), units: after[0], operator: operator, interpolate: [{ property: 'operator' }, { property: 'units' }] }"
25501
25566
  },
25502
25567
  {
25503
- "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:216",
25568
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:223",
25504
25569
  "id": "dimension"
25505
25570
  },
25506
25571
  {
25507
- "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:220",
25572
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:227",
25508
25573
  "id": "quantity",
25509
25574
  "isA": [
25510
25575
  "noun"
25511
25576
  ],
25577
+ "check": [
25578
+ "marker",
25579
+ "text",
25580
+ "verbatim",
25581
+ "value",
25582
+ "evalue",
25583
+ "isResponse",
25584
+ {
25585
+ "properties": "modifiers"
25586
+ },
25587
+ {
25588
+ "properties": "postModifiers"
25589
+ },
25590
+ "amount",
25591
+ "unit"
25592
+ ],
25512
25593
  "generatorp": {
25513
25594
  "level": 1
25514
25595
  },
@@ -25527,10 +25608,13 @@
25527
25608
  {
25528
25609
  "id": "amountOfCoordinate",
25529
25610
  "convolution": true,
25611
+ "before": [
25612
+ "preposition"
25613
+ ],
25530
25614
  "bridge": "{ marker: next(operator('quantity')), dead: true, unit: after[0], amount: before[0] }"
25531
25615
  },
25532
25616
  {
25533
- "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:248",
25617
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dimension.js:257",
25534
25618
  "id": "convertToUnits",
25535
25619
  "bridge": "{ ...next(operator), from: before[0], to: after[0] }",
25536
25620
  "isA": [
@@ -37,8 +37,8 @@ class API {
37
37
  this._objects = objects
38
38
  }
39
39
 
40
- getPreferredUnits(quantity) {
41
- const preferredUnits = this.args.mentions({
40
+ async getPreferredUnits(quantity) {
41
+ const preferredUnits = await this.args.mentions({
42
42
  context: { marker: 'unit' },
43
43
  condition: (unit) => {
44
44
  if (quantity.unit.marker == 'unitPerUnit') {
@@ -168,6 +168,7 @@ const config = {
168
168
  "((amount/* || number/*) [amountOfCoordinate|] ([unit]))",
169
169
  "(([amount]) [unit])",
170
170
  "((@<=quantity || context.possession == true) [convertToUnits|in] (unit))",
171
+ "([forQuantity|for] (@<= quantity && !context.unit.dimension == null))",
171
172
 
172
173
  "([useUnits|use] (unit))",
173
174
  "([preferredUnits] (quantity))",
@@ -188,13 +189,19 @@ const config = {
188
189
  },
189
190
  ],
190
191
  bridges: [
192
+ {
193
+ id: 'forQuantity',
194
+ isA: ['preposition'],
195
+ bridge: "{ ...operator, quantity: after[0], operator: operator, interpolate: [ { property: 'operator' }, { property: 'quantity' } ] }",
196
+ check: defaultContextCheckProperties(['quantity']),
197
+ },
191
198
  {
192
199
  where: where(),
193
200
  id: "preferredUnits",
194
201
  isA: ['verb'],
195
202
  bridge: "{ ...next(operator), quantity: after[0], operator: operator, interpolate: [{ property: 'operator' }, { property: 'quantity' }] }",
196
203
  semantic: async ({context, e, api, toArray, resolveResponse}) => {
197
- const preferredUnits = api.getPreferredUnits(context.quantity)
204
+ const preferredUnits = await api.getPreferredUnits(context.quantity)
198
205
  if (!preferredUnits) {
199
206
  return
200
207
  }
@@ -220,6 +227,7 @@ const config = {
220
227
  where: where(),
221
228
  id: "quantity",
222
229
  isA: ['noun'],
230
+ check: defaultContextCheckProperties(['amount', 'unit']),
223
231
  // bridge: "{ ...next(operator) }",
224
232
  generatorp: {
225
233
  level: 1,
@@ -241,6 +249,7 @@ const config = {
241
249
  {
242
250
  id: "amountOfCoordinate",
243
251
  convolution: true,
252
+ before: ['preposition'],
244
253
  // bridge: "{ marker: next(operator('quantity')), dead: true, unit: after[0], value: before[0].value, amount: before[0] }"
245
254
  bridge: "{ marker: next(operator('quantity')), dead: true, unit: after[0], amount: before[0] }"
246
255
  },