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.
- package/common/actions.instance.json +130 -5
- package/common/actions.js +54 -4
- package/common/actions.test.json +31359 -322
- package/common/angle.instance.json +58 -834
- package/common/articles.js +1 -2
- package/common/compass.instance.json +3 -18
- package/common/concept.js +2 -1
- package/common/conjunction.js +11 -17
- package/common/dialogues.js +3 -3
- package/common/dimension.instance.json +4 -69
- package/common/dimension.js +5 -5
- package/common/drone.instance.json +14985 -2538
- package/common/drone.js +276 -61
- package/common/drone.test.json +412474 -28440
- package/common/drone_v1.instance.json +324 -44
- package/common/drone_v1.js +9 -9
- package/common/edible.instance.json +72 -0
- package/common/fastfood.instance.json +5 -72
- package/common/fastfood.js +1 -1
- package/common/formulas.instance.json +0 -5
- package/common/formulas.js +1 -1
- package/common/gdefaults.js +16 -5
- package/common/helpers/conjunction.js +2 -0
- package/common/helpers/formulas.js +6 -0
- package/common/helpers/properties.js +9 -7
- package/common/helpers.js +9 -5
- package/common/hierarchy.js +2 -0
- package/common/length.instance.json +555 -5686
- package/common/math.instance.json +10 -12
- package/common/math.js +6 -5
- package/common/menus.instance.json +0 -35
- package/common/meta.js +1 -1
- package/common/nameable.js +7 -9
- package/common/ordinals.js +51 -5
- package/common/pipboy.instance.json +0 -85
- package/common/pipboy.js +1 -1
- package/common/pressure.instance.json +28 -370
- package/common/properties.js +4 -3
- package/common/rates.instance.json +1 -1
- package/common/rates.js +3 -3
- package/common/reminders.js +1 -1
- package/common/reports.instance.json +9 -176
- package/common/reports.js +2 -2
- package/common/scorekeeper.js +1 -1
- package/common/sdefaults.js +40 -5
- package/common/stm.js +50 -42
- package/common/temperature.instance.json +648 -2303
- package/common/time.instance.json +7376 -1965
- package/common/time.js +22 -1
- package/common/time.test.json +13239 -0
- package/common/ui.instance.json +0 -5
- package/common/ui.js +1 -1
- package/common/weight.instance.json +329 -1834
- package/common/wp.instance.json +88 -70
- package/package.json +3 -3
package/common/articles.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { knowledgeModule, where, stableId } = require('./runtime').theprogrammablemind
|
|
1
|
+
const { knowledgeModule, where, stableId, debug } = require('./runtime').theprogrammablemind
|
|
2
2
|
const gdefaults = require('./gdefaults.js')
|
|
3
3
|
const pos = require('./pos.js')
|
|
4
4
|
const { defaultContextCheck } = require('./helpers')
|
|
@@ -63,7 +63,6 @@ const config = {
|
|
|
63
63
|
id: "theAble",
|
|
64
64
|
children: ['noun'],
|
|
65
65
|
},
|
|
66
|
-
|
|
67
66
|
{
|
|
68
67
|
id: "thisitthat",
|
|
69
68
|
isA: ['queryable'],
|
|
@@ -782,11 +782,6 @@
|
|
|
782
782
|
"expression",
|
|
783
783
|
false
|
|
784
784
|
],
|
|
785
|
-
[
|
|
786
|
-
"mathematicalExpression",
|
|
787
|
-
"number",
|
|
788
|
-
false
|
|
789
|
-
],
|
|
790
785
|
[
|
|
791
786
|
"mathematical_operator",
|
|
792
787
|
"adjective",
|
|
@@ -1764,7 +1759,7 @@
|
|
|
1764
1759
|
],
|
|
1765
1760
|
[
|
|
1766
1761
|
"unit",
|
|
1767
|
-
"
|
|
1762
|
+
"mathematicalExpression",
|
|
1768
1763
|
false
|
|
1769
1764
|
],
|
|
1770
1765
|
[
|
|
@@ -3022,11 +3017,6 @@
|
|
|
3022
3017
|
"expression",
|
|
3023
3018
|
false
|
|
3024
3019
|
],
|
|
3025
|
-
[
|
|
3026
|
-
"mathematicalExpression",
|
|
3027
|
-
"number",
|
|
3028
|
-
false
|
|
3029
|
-
],
|
|
3030
3020
|
[
|
|
3031
3021
|
"mathematical_operator",
|
|
3032
3022
|
"adjective",
|
|
@@ -4004,7 +3994,7 @@
|
|
|
4004
3994
|
],
|
|
4005
3995
|
[
|
|
4006
3996
|
"unit",
|
|
4007
|
-
"
|
|
3997
|
+
"mathematicalExpression",
|
|
4008
3998
|
false
|
|
4009
3999
|
],
|
|
4010
4000
|
[
|
|
@@ -6620,11 +6610,6 @@
|
|
|
6620
6610
|
"expression",
|
|
6621
6611
|
false
|
|
6622
6612
|
],
|
|
6623
|
-
[
|
|
6624
|
-
"mathematicalExpression",
|
|
6625
|
-
"number",
|
|
6626
|
-
false
|
|
6627
|
-
],
|
|
6628
6613
|
[
|
|
6629
6614
|
"mathematical_operator",
|
|
6630
6615
|
"adjective",
|
|
@@ -7782,7 +7767,7 @@
|
|
|
7782
7767
|
],
|
|
7783
7768
|
[
|
|
7784
7769
|
"unit",
|
|
7785
|
-
"
|
|
7770
|
+
"mathematicalExpression",
|
|
7786
7771
|
false
|
|
7787
7772
|
],
|
|
7788
7773
|
[
|
package/common/concept.js
CHANGED
|
@@ -91,7 +91,7 @@ config = {
|
|
|
91
91
|
if ((context.value || []).length < 2) {
|
|
92
92
|
return
|
|
93
93
|
}
|
|
94
|
-
if (!context
|
|
94
|
+
if (!context?.value[0]?.word) {
|
|
95
95
|
return
|
|
96
96
|
}
|
|
97
97
|
const word = context.value[0].word
|
|
@@ -110,6 +110,7 @@ config = {
|
|
|
110
110
|
context.modifiers = ['modifier']
|
|
111
111
|
context.modifier = {
|
|
112
112
|
marker: 'list',
|
|
113
|
+
listable: true,
|
|
113
114
|
paraphrase: true,
|
|
114
115
|
value: modifiers
|
|
115
116
|
}
|
package/common/conjunction.js
CHANGED
|
@@ -21,10 +21,8 @@ const config = {
|
|
|
21
21
|
*/
|
|
22
22
|
selector: {
|
|
23
23
|
match: "same",
|
|
24
|
-
left: [ { pattern: '($type && context.instance == variables.instance)' } ],
|
|
25
|
-
right: [ { pattern: '($type && context.instance == variables.instance)' } ],
|
|
26
|
-
// left: [ { pattern: '($type)' } ],
|
|
27
|
-
// right: [ { pattern: '($type)' } ],
|
|
24
|
+
left: [ { pattern: '($type && context.instance == variables.instance && context.dead == variables.dead && !@<=$contexts[1].notConjunctableWith))' } ],
|
|
25
|
+
right: [ { pattern: '($type && context.instance == variables.instance && context.dead == variables.dead && !@<=$contexts[-1].notConjunctableWith))' } ],
|
|
28
26
|
passthrough: true
|
|
29
27
|
},
|
|
30
28
|
bridge: "{ ...next(operator), listable: true, isList: true, value: append(before, after) }"
|
|
@@ -34,7 +32,7 @@ const config = {
|
|
|
34
32
|
level: 1,
|
|
35
33
|
selector: {
|
|
36
34
|
match: "same",
|
|
37
|
-
left: [ { pattern: '($type && context.instance == variables.instance)' } ],
|
|
35
|
+
left: [ { pattern: '($type && context.instance == variables.instance && context.dead == variables.dead)' } ],
|
|
38
36
|
passthrough: true
|
|
39
37
|
},
|
|
40
38
|
bridge: "{ ...operator, value: append(before, operator.value) }"
|
|
@@ -63,18 +61,6 @@ const config = {
|
|
|
63
61
|
return `${await g(context.value[0])} ${await gs(context.value.slice(1), ', ', ' and ')}`
|
|
64
62
|
}
|
|
65
63
|
},
|
|
66
|
-
|
|
67
|
-
/*
|
|
68
|
-
{
|
|
69
|
-
where: where(),
|
|
70
|
-
notes: 'handle lists with truthValue set',
|
|
71
|
-
match: ({context, hierarchy}) => context.marker == 'list' && context.hasOwnProperty('truthValue'),
|
|
72
|
-
apply: async ({context, g, gs}) => {
|
|
73
|
-
return context.truthValue ? 'yes' : 'no'
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
64
|
{
|
|
79
65
|
where: where(),
|
|
80
66
|
notes: 'handle lists',
|
|
@@ -87,6 +73,14 @@ const config = {
|
|
|
87
73
|
}
|
|
88
74
|
}
|
|
89
75
|
},
|
|
76
|
+
|
|
77
|
+
{
|
|
78
|
+
where: where(),
|
|
79
|
+
match: ({context, callId}) => context.listable && context.value,
|
|
80
|
+
apply: ({context, gs}) => {
|
|
81
|
+
return gs(context.value, ' ', ' ' + context.word + ' ')
|
|
82
|
+
},
|
|
83
|
+
},
|
|
90
84
|
],
|
|
91
85
|
};
|
|
92
86
|
|
package/common/dialogues.js
CHANGED
|
@@ -544,12 +544,12 @@ const config = {
|
|
|
544
544
|
concept = two;
|
|
545
545
|
value = one;
|
|
546
546
|
}
|
|
547
|
-
// km('dialogues').api.
|
|
547
|
+
// km('dialogues').api.remember(concept)
|
|
548
548
|
// TODO wtf is the next line?
|
|
549
549
|
value = JSON.parse(JSON.stringify(value))
|
|
550
550
|
const instance = await e(value)
|
|
551
551
|
if (false && instance.evalue) {
|
|
552
|
-
km('stm').api.
|
|
552
|
+
km('stm').api.remember({ context: value })
|
|
553
553
|
}
|
|
554
554
|
if (instance.verbatim) {
|
|
555
555
|
context.evalue = { verbatim: instance.verbatim }
|
|
@@ -647,7 +647,7 @@ const config = {
|
|
|
647
647
|
for (const child of propertyToArray(one)) {
|
|
648
648
|
await api.makeObject({ context: child, config, types: context.two.types || [] })
|
|
649
649
|
kms.stm.api.setVariable(child.value, two)
|
|
650
|
-
kms.stm.api.
|
|
650
|
+
kms.stm.api.remember({ context: child, value: two })
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
653
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"operators": [
|
|
22
22
|
"([quantity])",
|
|
23
23
|
"([unit])",
|
|
24
|
-
"((amount/* || number/*) [amountOfCoordinate|] ([unit]))",
|
|
24
|
+
"((amount/* || number/* || mathematicalExpression/*) [amountOfCoordinate|] ([unit]))",
|
|
25
25
|
"(([amount]) [unit])",
|
|
26
26
|
"((@<=quantity || context.possession == true) [convertToUnits|in] (unit))",
|
|
27
27
|
"([forQuantity|for] (@<= quantity && !context.unit.dimension == null))",
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
{
|
|
179
179
|
"id": "unit",
|
|
180
180
|
"isA": [
|
|
181
|
-
"
|
|
181
|
+
"mathematicalExpression"
|
|
182
182
|
]
|
|
183
183
|
}
|
|
184
184
|
]
|
|
@@ -727,11 +727,6 @@
|
|
|
727
727
|
"expression",
|
|
728
728
|
false
|
|
729
729
|
],
|
|
730
|
-
[
|
|
731
|
-
"mathematicalExpression",
|
|
732
|
-
"number",
|
|
733
|
-
false
|
|
734
|
-
],
|
|
735
730
|
[
|
|
736
731
|
"mathematical_operator",
|
|
737
732
|
"adjective",
|
|
@@ -2290,11 +2285,6 @@
|
|
|
2290
2285
|
"expression",
|
|
2291
2286
|
false
|
|
2292
2287
|
],
|
|
2293
|
-
[
|
|
2294
|
-
"mathematicalExpression",
|
|
2295
|
-
"number",
|
|
2296
|
-
false
|
|
2297
|
-
],
|
|
2298
2288
|
[
|
|
2299
2289
|
"mathematical_operator",
|
|
2300
2290
|
"adjective",
|
|
@@ -3760,11 +3750,6 @@
|
|
|
3760
3750
|
"expression",
|
|
3761
3751
|
false
|
|
3762
3752
|
],
|
|
3763
|
-
[
|
|
3764
|
-
"mathematicalExpression",
|
|
3765
|
-
"number",
|
|
3766
|
-
false
|
|
3767
|
-
],
|
|
3768
3753
|
[
|
|
3769
3754
|
"mathematical_operator",
|
|
3770
3755
|
"adjective",
|
|
@@ -5786,11 +5771,6 @@
|
|
|
5786
5771
|
"expression",
|
|
5787
5772
|
false
|
|
5788
5773
|
],
|
|
5789
|
-
[
|
|
5790
|
-
"mathematicalExpression",
|
|
5791
|
-
"number",
|
|
5792
|
-
false
|
|
5793
|
-
],
|
|
5794
5774
|
[
|
|
5795
5775
|
"mathematical_operator",
|
|
5796
5776
|
"adjective",
|
|
@@ -7503,11 +7483,6 @@
|
|
|
7503
7483
|
"expression",
|
|
7504
7484
|
false
|
|
7505
7485
|
],
|
|
7506
|
-
[
|
|
7507
|
-
"mathematicalExpression",
|
|
7508
|
-
"number",
|
|
7509
|
-
false
|
|
7510
|
-
],
|
|
7511
7486
|
[
|
|
7512
7487
|
"mathematical_operator",
|
|
7513
7488
|
"adjective",
|
|
@@ -9153,11 +9128,6 @@
|
|
|
9153
9128
|
"expression",
|
|
9154
9129
|
false
|
|
9155
9130
|
],
|
|
9156
|
-
[
|
|
9157
|
-
"mathematicalExpression",
|
|
9158
|
-
"number",
|
|
9159
|
-
false
|
|
9160
|
-
],
|
|
9161
9131
|
[
|
|
9162
9132
|
"mathematical_operator",
|
|
9163
9133
|
"adjective",
|
|
@@ -11042,11 +11012,6 @@
|
|
|
11042
11012
|
"expression",
|
|
11043
11013
|
false
|
|
11044
11014
|
],
|
|
11045
|
-
[
|
|
11046
|
-
"mathematicalExpression",
|
|
11047
|
-
"number",
|
|
11048
|
-
false
|
|
11049
|
-
],
|
|
11050
11015
|
[
|
|
11051
11016
|
"mathematical_operator",
|
|
11052
11017
|
"adjective",
|
|
@@ -12931,11 +12896,6 @@
|
|
|
12931
12896
|
"expression",
|
|
12932
12897
|
false
|
|
12933
12898
|
],
|
|
12934
|
-
[
|
|
12935
|
-
"mathematicalExpression",
|
|
12936
|
-
"number",
|
|
12937
|
-
false
|
|
12938
|
-
],
|
|
12939
12899
|
[
|
|
12940
12900
|
"mathematical_operator",
|
|
12941
12901
|
"adjective",
|
|
@@ -15294,11 +15254,6 @@
|
|
|
15294
15254
|
"expression",
|
|
15295
15255
|
false
|
|
15296
15256
|
],
|
|
15297
|
-
[
|
|
15298
|
-
"mathematicalExpression",
|
|
15299
|
-
"number",
|
|
15300
|
-
false
|
|
15301
|
-
],
|
|
15302
15257
|
[
|
|
15303
15258
|
"mathematical_operator",
|
|
15304
15259
|
"adjective",
|
|
@@ -17667,11 +17622,6 @@
|
|
|
17667
17622
|
"expression",
|
|
17668
17623
|
false
|
|
17669
17624
|
],
|
|
17670
|
-
[
|
|
17671
|
-
"mathematicalExpression",
|
|
17672
|
-
"number",
|
|
17673
|
-
false
|
|
17674
|
-
],
|
|
17675
17625
|
[
|
|
17676
17626
|
"mathematical_operator",
|
|
17677
17627
|
"adjective",
|
|
@@ -19676,11 +19626,6 @@
|
|
|
19676
19626
|
"expression",
|
|
19677
19627
|
false
|
|
19678
19628
|
],
|
|
19679
|
-
[
|
|
19680
|
-
"mathematicalExpression",
|
|
19681
|
-
"number",
|
|
19682
|
-
false
|
|
19683
|
-
],
|
|
19684
19629
|
[
|
|
19685
19630
|
"mathematical_operator",
|
|
19686
19631
|
"adjective",
|
|
@@ -21685,11 +21630,6 @@
|
|
|
21685
21630
|
"expression",
|
|
21686
21631
|
false
|
|
21687
21632
|
],
|
|
21688
|
-
[
|
|
21689
|
-
"mathematicalExpression",
|
|
21690
|
-
"number",
|
|
21691
|
-
false
|
|
21692
|
-
],
|
|
21693
21633
|
[
|
|
21694
21634
|
"mathematical_operator",
|
|
21695
21635
|
"adjective",
|
|
@@ -23958,11 +23898,6 @@
|
|
|
23958
23898
|
"expression",
|
|
23959
23899
|
false
|
|
23960
23900
|
],
|
|
23961
|
-
[
|
|
23962
|
-
"mathematicalExpression",
|
|
23963
|
-
"number",
|
|
23964
|
-
false
|
|
23965
|
-
],
|
|
23966
23901
|
[
|
|
23967
23902
|
"mathematical_operator",
|
|
23968
23903
|
"adjective",
|
|
@@ -25485,7 +25420,7 @@
|
|
|
25485
25420
|
"operators": [
|
|
25486
25421
|
"([quantity])",
|
|
25487
25422
|
"([unit])",
|
|
25488
|
-
"((amount/* || number/*) [amountOfCoordinate|] ([unit]))",
|
|
25423
|
+
"((amount/* || number/* || mathematicalExpression/*) [amountOfCoordinate|] ([unit]))",
|
|
25489
25424
|
"(([amount]) [unit])",
|
|
25490
25425
|
"((@<=quantity || context.possession == true) [convertToUnits|in] (unit))",
|
|
25491
25426
|
"([forQuantity|for] (@<= quantity && !context.unit.dimension == null))",
|
|
@@ -25641,7 +25576,7 @@
|
|
|
25641
25576
|
{
|
|
25642
25577
|
"id": "unit",
|
|
25643
25578
|
"isA": [
|
|
25644
|
-
"
|
|
25579
|
+
"mathematicalExpression"
|
|
25645
25580
|
]
|
|
25646
25581
|
}
|
|
25647
25582
|
]
|
package/common/dimension.js
CHANGED
|
@@ -38,7 +38,7 @@ class API {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
async getPreferredUnits(quantity) {
|
|
41
|
-
const preferredUnits = await this.args.
|
|
41
|
+
const preferredUnits = await this.args.recall({
|
|
42
42
|
context: { marker: 'unit' },
|
|
43
43
|
condition: (unit) => {
|
|
44
44
|
if (quantity.unit.marker == 'unitPerUnit') {
|
|
@@ -57,7 +57,7 @@ class API {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
setPreferredUnits(units) {
|
|
60
|
-
this.args.
|
|
60
|
+
this.args.remember(units)
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
setMeasurementSystem(measurementSystem) {
|
|
@@ -108,7 +108,7 @@ class API {
|
|
|
108
108
|
const formula = kms.formulas.api.get(to, [efrom.unit])
|
|
109
109
|
if (!formula) {
|
|
110
110
|
const reason = { marker: 'reason', focusableForPhrase: true, evalue: { marker: 'noconversion', from: efrom.unit, to } }
|
|
111
|
-
kms.stm.api.
|
|
111
|
+
kms.stm.api.remember({ context: reason })
|
|
112
112
|
error(reason)
|
|
113
113
|
}
|
|
114
114
|
kms.stm.api.setVariable(efrom.unit.value, efrom.amount)
|
|
@@ -165,7 +165,7 @@ const config = {
|
|
|
165
165
|
operators: [
|
|
166
166
|
"([quantity])",
|
|
167
167
|
"([unit])",
|
|
168
|
-
"((amount/* || number/*) [amountOfCoordinate|] ([unit]))",
|
|
168
|
+
"((amount/* || number/* || mathematicalExpression/*) [amountOfCoordinate|] ([unit]))",
|
|
169
169
|
"(([amount]) [unit])",
|
|
170
170
|
"((@<=quantity || context.possession == true) [convertToUnits|in] (unit))",
|
|
171
171
|
"([forQuantity|for] (@<= quantity && !context.unit.dimension == null))",
|
|
@@ -270,7 +270,7 @@ const config = {
|
|
|
270
270
|
},
|
|
271
271
|
{
|
|
272
272
|
id: "unit",
|
|
273
|
-
isA: ['
|
|
273
|
+
isA: ['mathematicalExpression'],
|
|
274
274
|
},
|
|
275
275
|
],
|
|
276
276
|
};
|