ekms 8.0.0-beta.35 → 8.0.0-beta.37
Sign up to get free protection for your applications and to get access to all the features.
- package/common/nameable.js +8 -17
- package/common/nameable.test.json +128 -64
- package/common/stm.js +6 -3
- package/common/stm.test.json +48 -16
- package/package.json +2 -2
package/common/nameable.js
CHANGED
@@ -12,10 +12,13 @@ class API {
|
|
12
12
|
|
13
13
|
// report is a context
|
14
14
|
setName(context, name) {
|
15
|
-
if (!context.
|
16
|
-
context.
|
15
|
+
if (!context.nameable) {
|
16
|
+
context.nameable = {}
|
17
17
|
}
|
18
|
-
context.
|
18
|
+
if (!context.nameable.names) {
|
19
|
+
context.nameable.names = []
|
20
|
+
}
|
21
|
+
context.nameable.names.push(name)
|
19
22
|
}
|
20
23
|
|
21
24
|
get(name) {
|
@@ -23,12 +26,11 @@ class API {
|
|
23
26
|
}
|
24
27
|
|
25
28
|
getNamesByType(type) {
|
26
|
-
debugger
|
27
29
|
const contexts = this.args.kms.stm.api.getByType(type)
|
28
30
|
const names = new Set()
|
29
31
|
for (const context of contexts) {
|
30
|
-
if (context.
|
31
|
-
for (const name of context.
|
32
|
+
if (context.nameable.names) {
|
33
|
+
for (const name of context.nameable.names) {
|
32
34
|
names.add(name)
|
33
35
|
}
|
34
36
|
}
|
@@ -105,17 +107,6 @@ const configStruct = {
|
|
105
107
|
let createConfig = async () => {
|
106
108
|
const config = new Config(configStruct, module)
|
107
109
|
config.stop_auto_rebuild()
|
108
|
-
|
109
|
-
await config.initializer( ({config}) => {
|
110
|
-
config.addArgs(({kms}) => ({
|
111
|
-
mentioned: (context) => {
|
112
|
-
kms.nameable.api.mentioned(context)
|
113
|
-
},
|
114
|
-
mentions: (context) => {
|
115
|
-
return kms.nameable.api.mentions(context)
|
116
|
-
},
|
117
|
-
}))
|
118
|
-
})
|
119
110
|
await config.setApi(api)
|
120
111
|
await config.add(stm)
|
121
112
|
|
@@ -93,15 +93,19 @@
|
|
93
93
|
"fromSTM": true,
|
94
94
|
"level": 1,
|
95
95
|
"marker": "m1",
|
96
|
-
"
|
97
|
-
"
|
98
|
-
|
96
|
+
"nameable": {
|
97
|
+
"names": [
|
98
|
+
"banana"
|
99
|
+
]
|
100
|
+
},
|
99
101
|
"pullFromContext": false,
|
100
102
|
"range": {
|
101
103
|
"end": 10,
|
102
104
|
"start": 9
|
103
105
|
},
|
104
|
-
"
|
106
|
+
"stm": {
|
107
|
+
"id": 1
|
108
|
+
},
|
105
109
|
"text": "m1",
|
106
110
|
"types": [
|
107
111
|
"m1"
|
@@ -349,15 +353,19 @@
|
|
349
353
|
"fromSTM": true,
|
350
354
|
"level": 1,
|
351
355
|
"marker": "m1",
|
352
|
-
"
|
353
|
-
"
|
354
|
-
|
356
|
+
"nameable": {
|
357
|
+
"names": [
|
358
|
+
"banana"
|
359
|
+
]
|
360
|
+
},
|
355
361
|
"pullFromContext": false,
|
356
362
|
"range": {
|
357
363
|
"end": 10,
|
358
364
|
"start": 9
|
359
365
|
},
|
360
|
-
"
|
366
|
+
"stm": {
|
367
|
+
"id": 1
|
368
|
+
},
|
361
369
|
"text": "m1",
|
362
370
|
"types": [
|
363
371
|
"m1"
|
@@ -455,15 +463,19 @@
|
|
455
463
|
"fromSTM": true,
|
456
464
|
"level": 1,
|
457
465
|
"marker": "m1",
|
458
|
-
"
|
459
|
-
"
|
460
|
-
|
466
|
+
"nameable": {
|
467
|
+
"names": [
|
468
|
+
"banana"
|
469
|
+
]
|
470
|
+
},
|
461
471
|
"pullFromContext": false,
|
462
472
|
"range": {
|
463
473
|
"end": 10,
|
464
474
|
"start": 9
|
465
475
|
},
|
466
|
-
"
|
476
|
+
"stm": {
|
477
|
+
"id": 1
|
478
|
+
},
|
467
479
|
"text": "m1",
|
468
480
|
"types": [
|
469
481
|
"m1"
|
@@ -537,15 +549,19 @@
|
|
537
549
|
"fromSTM": true,
|
538
550
|
"level": 1,
|
539
551
|
"marker": "m1",
|
540
|
-
"
|
541
|
-
"
|
542
|
-
|
552
|
+
"nameable": {
|
553
|
+
"names": [
|
554
|
+
"banana"
|
555
|
+
]
|
556
|
+
},
|
543
557
|
"pullFromContext": false,
|
544
558
|
"range": {
|
545
559
|
"end": 10,
|
546
560
|
"start": 9
|
547
561
|
},
|
548
|
-
"
|
562
|
+
"stm": {
|
563
|
+
"id": 1
|
564
|
+
},
|
549
565
|
"text": "m1",
|
550
566
|
"types": [
|
551
567
|
"m1"
|
@@ -634,15 +650,19 @@
|
|
634
650
|
"fromSTM": true,
|
635
651
|
"level": 1,
|
636
652
|
"marker": "m1",
|
637
|
-
"
|
638
|
-
"
|
639
|
-
|
653
|
+
"nameable": {
|
654
|
+
"names": [
|
655
|
+
"banana"
|
656
|
+
]
|
657
|
+
},
|
640
658
|
"pullFromContext": false,
|
641
659
|
"range": {
|
642
660
|
"end": 10,
|
643
661
|
"start": 9
|
644
662
|
},
|
645
|
-
"
|
663
|
+
"stm": {
|
664
|
+
"id": 1
|
665
|
+
},
|
646
666
|
"text": "m1",
|
647
667
|
"types": [
|
648
668
|
"m1"
|
@@ -848,15 +868,19 @@
|
|
848
868
|
"fromSTM": true,
|
849
869
|
"level": 1,
|
850
870
|
"marker": "m1",
|
851
|
-
"
|
852
|
-
"
|
853
|
-
|
871
|
+
"nameable": {
|
872
|
+
"names": [
|
873
|
+
"banana"
|
874
|
+
]
|
875
|
+
},
|
854
876
|
"pullFromContext": false,
|
855
877
|
"range": {
|
856
878
|
"end": 10,
|
857
879
|
"start": 9
|
858
880
|
},
|
859
|
-
"
|
881
|
+
"stm": {
|
882
|
+
"id": 1
|
883
|
+
},
|
860
884
|
"text": "m1",
|
861
885
|
"types": [
|
862
886
|
"m1"
|
@@ -892,15 +916,19 @@
|
|
892
916
|
"fromSTM": true,
|
893
917
|
"level": 1,
|
894
918
|
"marker": "m1",
|
895
|
-
"
|
896
|
-
"
|
897
|
-
|
919
|
+
"nameable": {
|
920
|
+
"names": [
|
921
|
+
"banana"
|
922
|
+
]
|
923
|
+
},
|
898
924
|
"pullFromContext": false,
|
899
925
|
"range": {
|
900
926
|
"end": 10,
|
901
927
|
"start": 9
|
902
928
|
},
|
903
|
-
"
|
929
|
+
"stm": {
|
930
|
+
"id": 1
|
931
|
+
},
|
904
932
|
"text": "m1",
|
905
933
|
"types": [
|
906
934
|
"m1"
|
@@ -1017,15 +1045,19 @@
|
|
1017
1045
|
"fromSTM": true,
|
1018
1046
|
"level": 1,
|
1019
1047
|
"marker": "m1",
|
1020
|
-
"
|
1021
|
-
"
|
1022
|
-
|
1048
|
+
"nameable": {
|
1049
|
+
"names": [
|
1050
|
+
"banana"
|
1051
|
+
]
|
1052
|
+
},
|
1023
1053
|
"pullFromContext": false,
|
1024
1054
|
"range": {
|
1025
1055
|
"end": 10,
|
1026
1056
|
"start": 9
|
1027
1057
|
},
|
1028
|
-
"
|
1058
|
+
"stm": {
|
1059
|
+
"id": 1
|
1060
|
+
},
|
1029
1061
|
"text": "m1",
|
1030
1062
|
"types": [
|
1031
1063
|
"m1"
|
@@ -1101,15 +1133,19 @@
|
|
1101
1133
|
"fromSTM": true,
|
1102
1134
|
"level": 1,
|
1103
1135
|
"marker": "m1",
|
1104
|
-
"
|
1105
|
-
"
|
1106
|
-
|
1136
|
+
"nameable": {
|
1137
|
+
"names": [
|
1138
|
+
"banana"
|
1139
|
+
]
|
1140
|
+
},
|
1107
1141
|
"pullFromContext": false,
|
1108
1142
|
"range": {
|
1109
1143
|
"end": 10,
|
1110
1144
|
"start": 9
|
1111
1145
|
},
|
1112
|
-
"
|
1146
|
+
"stm": {
|
1147
|
+
"id": 1
|
1148
|
+
},
|
1113
1149
|
"text": "m1",
|
1114
1150
|
"types": [
|
1115
1151
|
"m1"
|
@@ -1388,15 +1424,19 @@
|
|
1388
1424
|
"fromSTM": true,
|
1389
1425
|
"level": 1,
|
1390
1426
|
"marker": "m1",
|
1391
|
-
"
|
1392
|
-
"
|
1393
|
-
|
1427
|
+
"nameable": {
|
1428
|
+
"names": [
|
1429
|
+
"banana"
|
1430
|
+
]
|
1431
|
+
},
|
1394
1432
|
"pullFromContext": false,
|
1395
1433
|
"range": {
|
1396
1434
|
"end": 10,
|
1397
1435
|
"start": 9
|
1398
1436
|
},
|
1399
|
-
"
|
1437
|
+
"stm": {
|
1438
|
+
"id": 1
|
1439
|
+
},
|
1400
1440
|
"text": "m1",
|
1401
1441
|
"types": [
|
1402
1442
|
"m1"
|
@@ -1533,15 +1573,19 @@
|
|
1533
1573
|
"fromSTM": true,
|
1534
1574
|
"level": 1,
|
1535
1575
|
"marker": "m1",
|
1536
|
-
"
|
1537
|
-
"
|
1538
|
-
|
1576
|
+
"nameable": {
|
1577
|
+
"names": [
|
1578
|
+
"banana"
|
1579
|
+
]
|
1580
|
+
},
|
1539
1581
|
"pullFromContext": false,
|
1540
1582
|
"range": {
|
1541
1583
|
"end": 10,
|
1542
1584
|
"start": 9
|
1543
1585
|
},
|
1544
|
-
"
|
1586
|
+
"stm": {
|
1587
|
+
"id": 1
|
1588
|
+
},
|
1545
1589
|
"text": "m1",
|
1546
1590
|
"types": [
|
1547
1591
|
"m1"
|
@@ -1607,15 +1651,19 @@
|
|
1607
1651
|
"fromSTM": true,
|
1608
1652
|
"level": 1,
|
1609
1653
|
"marker": "m1",
|
1610
|
-
"
|
1611
|
-
"
|
1612
|
-
|
1654
|
+
"nameable": {
|
1655
|
+
"names": [
|
1656
|
+
"banana"
|
1657
|
+
]
|
1658
|
+
},
|
1613
1659
|
"pullFromContext": false,
|
1614
1660
|
"range": {
|
1615
1661
|
"end": 10,
|
1616
1662
|
"start": 9
|
1617
1663
|
},
|
1618
|
-
"
|
1664
|
+
"stm": {
|
1665
|
+
"id": 1
|
1666
|
+
},
|
1619
1667
|
"text": "m1",
|
1620
1668
|
"types": [
|
1621
1669
|
"m1"
|
@@ -1706,15 +1754,19 @@
|
|
1706
1754
|
"fromSTM": true,
|
1707
1755
|
"level": 1,
|
1708
1756
|
"marker": "m1",
|
1709
|
-
"
|
1710
|
-
"
|
1711
|
-
|
1757
|
+
"nameable": {
|
1758
|
+
"names": [
|
1759
|
+
"banana"
|
1760
|
+
]
|
1761
|
+
},
|
1712
1762
|
"pullFromContext": false,
|
1713
1763
|
"range": {
|
1714
1764
|
"end": 10,
|
1715
1765
|
"start": 9
|
1716
1766
|
},
|
1717
|
-
"
|
1767
|
+
"stm": {
|
1768
|
+
"id": 1
|
1769
|
+
},
|
1718
1770
|
"text": "m1",
|
1719
1771
|
"types": [
|
1720
1772
|
"m1"
|
@@ -1884,15 +1936,19 @@
|
|
1884
1936
|
"fromSTM": true,
|
1885
1937
|
"level": 1,
|
1886
1938
|
"marker": "m1",
|
1887
|
-
"
|
1888
|
-
"
|
1889
|
-
|
1939
|
+
"nameable": {
|
1940
|
+
"names": [
|
1941
|
+
"banana"
|
1942
|
+
]
|
1943
|
+
},
|
1890
1944
|
"pullFromContext": false,
|
1891
1945
|
"range": {
|
1892
1946
|
"end": 10,
|
1893
1947
|
"start": 9
|
1894
1948
|
},
|
1895
|
-
"
|
1949
|
+
"stm": {
|
1950
|
+
"id": 1
|
1951
|
+
},
|
1896
1952
|
"text": "m1",
|
1897
1953
|
"types": [
|
1898
1954
|
"m1"
|
@@ -1930,15 +1986,19 @@
|
|
1930
1986
|
"fromSTM": true,
|
1931
1987
|
"level": 1,
|
1932
1988
|
"marker": "m1",
|
1933
|
-
"
|
1934
|
-
"
|
1935
|
-
|
1989
|
+
"nameable": {
|
1990
|
+
"names": [
|
1991
|
+
"banana"
|
1992
|
+
]
|
1993
|
+
},
|
1936
1994
|
"pullFromContext": false,
|
1937
1995
|
"range": {
|
1938
1996
|
"end": 10,
|
1939
1997
|
"start": 9
|
1940
1998
|
},
|
1941
|
-
"
|
1999
|
+
"stm": {
|
2000
|
+
"id": 1
|
2001
|
+
},
|
1942
2002
|
"text": "m1",
|
1943
2003
|
"types": [
|
1944
2004
|
"m1"
|
@@ -2036,15 +2096,19 @@
|
|
2036
2096
|
"fromSTM": true,
|
2037
2097
|
"level": 1,
|
2038
2098
|
"marker": "m1",
|
2039
|
-
"
|
2040
|
-
"
|
2041
|
-
|
2099
|
+
"nameable": {
|
2100
|
+
"names": [
|
2101
|
+
"banana"
|
2102
|
+
]
|
2103
|
+
},
|
2042
2104
|
"pullFromContext": false,
|
2043
2105
|
"range": {
|
2044
2106
|
"end": 10,
|
2045
2107
|
"start": 9
|
2046
2108
|
},
|
2047
|
-
"
|
2109
|
+
"stm": {
|
2110
|
+
"id": 1
|
2111
|
+
},
|
2048
2112
|
"text": "m1",
|
2049
2113
|
"types": [
|
2050
2114
|
"m1"
|
package/common/stm.js
CHANGED
@@ -55,10 +55,13 @@ class API {
|
|
55
55
|
concept.value = value
|
56
56
|
}
|
57
57
|
concept.fromSTM = true
|
58
|
-
if (!concept.
|
59
|
-
concept.
|
58
|
+
if (!concept.stm) {
|
59
|
+
concept.stm = {}
|
60
60
|
}
|
61
|
-
|
61
|
+
if (!concept.stm.id) {
|
62
|
+
concept.stm.id = this.getId()
|
63
|
+
}
|
64
|
+
this._objects.mentioned = this._objects.mentioned.filter( (context) => context.stm && context.stm.id != concept.stm.id )
|
62
65
|
this._objects.mentioned.unshift(concept)
|
63
66
|
}
|
64
67
|
|
package/common/stm.test.json
CHANGED
@@ -37,7 +37,9 @@
|
|
37
37
|
"end": 10,
|
38
38
|
"start": 9
|
39
39
|
},
|
40
|
-
"
|
40
|
+
"stm": {
|
41
|
+
"id": 1
|
42
|
+
},
|
41
43
|
"text": "m1",
|
42
44
|
"types": [
|
43
45
|
"memorable"
|
@@ -121,7 +123,9 @@
|
|
121
123
|
"end": 10,
|
122
124
|
"start": 9
|
123
125
|
},
|
124
|
-
"
|
126
|
+
"stm": {
|
127
|
+
"id": 1
|
128
|
+
},
|
125
129
|
"text": "m1",
|
126
130
|
"types": [
|
127
131
|
"memorable"
|
@@ -160,7 +164,9 @@
|
|
160
164
|
"end": 10,
|
161
165
|
"start": 9
|
162
166
|
},
|
163
|
-
"
|
167
|
+
"stm": {
|
168
|
+
"id": 1
|
169
|
+
},
|
164
170
|
"text": "m1",
|
165
171
|
"types": [
|
166
172
|
"memorable"
|
@@ -527,7 +533,9 @@
|
|
527
533
|
"end": 10,
|
528
534
|
"start": 9
|
529
535
|
},
|
530
|
-
"
|
536
|
+
"stm": {
|
537
|
+
"id": 1
|
538
|
+
},
|
531
539
|
"text": "m1",
|
532
540
|
"types": [
|
533
541
|
"memorable"
|
@@ -566,7 +574,9 @@
|
|
566
574
|
"end": 10,
|
567
575
|
"start": 9
|
568
576
|
},
|
569
|
-
"
|
577
|
+
"stm": {
|
578
|
+
"id": 1
|
579
|
+
},
|
570
580
|
"text": "m1",
|
571
581
|
"types": [
|
572
582
|
"memorable"
|
@@ -724,7 +734,9 @@
|
|
724
734
|
"end": 10,
|
725
735
|
"start": 9
|
726
736
|
},
|
727
|
-
"
|
737
|
+
"stm": {
|
738
|
+
"id": 1
|
739
|
+
},
|
728
740
|
"text": "m1",
|
729
741
|
"types": [
|
730
742
|
"memorable"
|
@@ -764,7 +776,9 @@
|
|
764
776
|
"end": 10,
|
765
777
|
"start": 9
|
766
778
|
},
|
767
|
-
"
|
779
|
+
"stm": {
|
780
|
+
"id": 1
|
781
|
+
},
|
768
782
|
"text": "m1",
|
769
783
|
"types": [
|
770
784
|
"memorable"
|
@@ -832,7 +846,9 @@
|
|
832
846
|
"end": 10,
|
833
847
|
"start": 9
|
834
848
|
},
|
835
|
-
"
|
849
|
+
"stm": {
|
850
|
+
"id": 1
|
851
|
+
},
|
836
852
|
"text": "m1",
|
837
853
|
"types": [
|
838
854
|
"memorable"
|
@@ -1167,7 +1183,9 @@
|
|
1167
1183
|
"end": 10,
|
1168
1184
|
"start": 9
|
1169
1185
|
},
|
1170
|
-
"
|
1186
|
+
"stm": {
|
1187
|
+
"id": 1
|
1188
|
+
},
|
1171
1189
|
"text": "m1",
|
1172
1190
|
"types": [
|
1173
1191
|
"memorable"
|
@@ -1205,7 +1223,9 @@
|
|
1205
1223
|
"end": 10,
|
1206
1224
|
"start": 9
|
1207
1225
|
},
|
1208
|
-
"
|
1226
|
+
"stm": {
|
1227
|
+
"id": 2
|
1228
|
+
},
|
1209
1229
|
"text": "m2",
|
1210
1230
|
"types": [
|
1211
1231
|
"memorable"
|
@@ -1244,7 +1264,9 @@
|
|
1244
1264
|
"end": 10,
|
1245
1265
|
"start": 9
|
1246
1266
|
},
|
1247
|
-
"
|
1267
|
+
"stm": {
|
1268
|
+
"id": 1
|
1269
|
+
},
|
1248
1270
|
"text": "m1",
|
1249
1271
|
"types": [
|
1250
1272
|
"memorable"
|
@@ -1472,7 +1494,9 @@
|
|
1472
1494
|
"end": 10,
|
1473
1495
|
"start": 9
|
1474
1496
|
},
|
1475
|
-
"
|
1497
|
+
"stm": {
|
1498
|
+
"id": 2
|
1499
|
+
},
|
1476
1500
|
"text": "m2",
|
1477
1501
|
"types": [
|
1478
1502
|
"memorable"
|
@@ -1490,7 +1514,9 @@
|
|
1490
1514
|
"end": 10,
|
1491
1515
|
"start": 9
|
1492
1516
|
},
|
1493
|
-
"
|
1517
|
+
"stm": {
|
1518
|
+
"id": 1
|
1519
|
+
},
|
1494
1520
|
"text": "m1",
|
1495
1521
|
"types": [
|
1496
1522
|
"memorable"
|
@@ -1530,7 +1556,9 @@
|
|
1530
1556
|
"end": 10,
|
1531
1557
|
"start": 9
|
1532
1558
|
},
|
1533
|
-
"
|
1559
|
+
"stm": {
|
1560
|
+
"id": 1
|
1561
|
+
},
|
1534
1562
|
"text": "m1",
|
1535
1563
|
"types": [
|
1536
1564
|
"memorable"
|
@@ -1612,7 +1640,9 @@
|
|
1612
1640
|
"end": 10,
|
1613
1641
|
"start": 9
|
1614
1642
|
},
|
1615
|
-
"
|
1643
|
+
"stm": {
|
1644
|
+
"id": 2
|
1645
|
+
},
|
1616
1646
|
"text": "m2",
|
1617
1647
|
"types": [
|
1618
1648
|
"memorable"
|
@@ -1658,7 +1688,9 @@
|
|
1658
1688
|
"end": 10,
|
1659
1689
|
"start": 9
|
1660
1690
|
},
|
1661
|
-
"
|
1691
|
+
"stm": {
|
1692
|
+
"id": 1
|
1693
|
+
},
|
1662
1694
|
"text": "m1",
|
1663
1695
|
"types": [
|
1664
1696
|
"memorable"
|
package/package.json
CHANGED
@@ -291,8 +291,8 @@
|
|
291
291
|
"table": "^6.7.1",
|
292
292
|
"base-64": "^1.0.0",
|
293
293
|
"argparse": "^2.0.1",
|
294
|
-
"theprogrammablemind": "8.0.0-beta.
|
294
|
+
"theprogrammablemind": "8.0.0-beta.37"
|
295
295
|
},
|
296
|
-
"version": "8.0.0-beta.
|
296
|
+
"version": "8.0.0-beta.37",
|
297
297
|
"license": "UNLICENSED"
|
298
298
|
}
|