tpmkms_4wp 9.5.1-beta.9 → 9.6.0-beta.0
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/animals.instance.json +130 -0
- package/common/animals.js +3 -5
- package/common/asking.js +12 -4
- package/common/avatar.test.json +1001 -860
- package/common/can.instance.json +2182 -5
- package/common/can.js +102 -39
- package/common/can.test.json +51307 -0
- package/common/colors.instance.json +142 -30
- package/common/colors.js +3 -6
- package/common/comparable.instance.json +31 -1
- package/common/comparable.js +3 -6
- package/common/concept.js +25 -27
- package/common/concept.test.json +142 -120
- package/common/conjunction.test.json +32 -42
- package/common/crew.instance.json +400 -126
- package/common/crew.js +3 -6
- package/common/dateTimeSelectors.instance.json +2 -2
- package/common/dateTimeSelectors.js +6 -9
- package/common/dateTimeSelectors.test.json +76935 -35739
- package/common/dates.instance.json +50 -84
- package/common/dates.js +3 -6
- package/common/dates.test.json +284 -287
- package/common/dialogues.js +33 -115
- package/common/dialogues.test.json +1248 -1152
- package/common/dimension.instance.json +21498 -566
- package/common/dimension.js +147 -52
- package/common/dimension.test.json +10979 -4625
- package/common/drone.instance.json +24709 -0
- package/common/drone.js +662 -0
- package/common/drone.test.json +30522 -0
- package/common/drone_v1.instance.json +24703 -0
- package/common/drone_v1.js +596 -0
- package/common/drone_v1.test.json +115538 -0
- package/common/edible.instance.json +365 -65
- package/common/edible.js +3 -5
- package/common/emotions.instance.json +57 -70
- package/common/emotions.js +3 -6
- package/common/errors.js +3 -3
- package/common/fastfood.instance.json +1270 -244
- package/common/fastfood.js +10 -12
- package/common/fastfood.test.json +6970 -6829
- package/common/formulas.instance.json +10 -0
- package/common/formulas.js +2 -1
- package/common/gdefaults.js +58 -13
- package/common/help.js +9 -9
- package/common/help.test.json +65 -11
- package/common/helpers/dialogues.js +9 -1
- package/common/helpers/properties.js +37 -18
- package/common/helpers.js +32 -2
- package/common/hierarchy.js +10 -8
- package/common/kirk.instance.json +10 -0
- package/common/kirk.js +4 -6
- package/common/kirk.test.json +600 -424
- package/common/latin.instance.json +10 -10
- package/common/latin.js +8 -10
- package/common/length.instance.json +34659 -3157
- package/common/length.js +11 -6
- package/common/length.test.json +54357 -2557
- package/common/math.instance.json +11 -1
- package/common/math.js +2 -1
- package/common/menus.instance.json +74 -7
- package/common/menus.js +3 -12
- package/common/meta.js +4 -5
- package/common/nameable.js +29 -15
- package/common/nameable.test.json +436 -0
- package/common/numbers.js +1 -1
- package/common/ordering.instance.json +24 -2
- package/common/ordering.js +3 -5
- package/common/ordering.test.json +104 -174
- package/common/people.instance.json +140 -315
- package/common/people.js +3 -5
- package/common/pipboy.instance.json +171 -57
- package/common/pipboy.js +2 -1
- package/common/pokemon.instance.json +135 -5
- package/common/pokemon.js +3 -5
- package/common/pressure.instance.json +3990 -1981
- package/common/pressure.js +3 -5
- package/common/pressure.test.json +433 -477
- package/common/properties.instance.json +15 -16
- package/common/properties.js +10 -9
- package/common/properties.test.json +9565 -6951
- package/common/rates.instance.json +59 -0
- package/common/rates.js +95 -0
- package/common/rates.test.json +27702 -0
- package/common/reminders.js +5 -8
- package/common/reminders.test.json +64635 -25787
- package/common/reports.instance.json +22 -2
- package/common/reports.js +3 -5
- package/common/scorekeeper.js +3 -6
- package/common/spock.instance.json +10 -0
- package/common/spock.js +4 -7
- package/common/spock.test.json +606 -430
- package/common/stm.js +37 -20
- package/common/temperature.instance.json +3162 -1153
- package/common/temperature.js +3 -5
- package/common/temperature.test.json +433 -477
- package/common/time.instance.json +24852 -0
- package/common/time.js +136 -139
- package/common/time.test.json +31876 -3757
- package/common/ui.instance.json +12 -5
- package/common/ui.js +4 -13
- package/common/weight.instance.json +10500 -4098
- package/common/weight.js +3 -5
- package/common/weight.test.json +2601 -2263
- package/common/words.instance.json +9 -0
- package/common/words.js +50 -0
- package/common/words.test.json +2 -0
- package/common/wp.instance.json +470 -58
- package/common/wp.js +6 -4
- package/common/wp.test.json +7385 -6906
- package/main.js +6 -2
- package/package.json +21 -6
- package/common/listener.js +0 -50
- package/common/listener.test.json +0 -142
package/common/stm.js
CHANGED
|
@@ -40,7 +40,16 @@ class API {
|
|
|
40
40
|
return this._objects.mentioned.filter( (context) => this.isA(context.marker, type) )
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
mentioned(
|
|
43
|
+
mentioned(args) {
|
|
44
|
+
let concept, value, frameOfReference
|
|
45
|
+
if (!args.context) {
|
|
46
|
+
concept = args
|
|
47
|
+
} else {
|
|
48
|
+
concept = args.context
|
|
49
|
+
value = args.value
|
|
50
|
+
frameOfReference = args.frameOfReference
|
|
51
|
+
}
|
|
52
|
+
|
|
44
53
|
if (!frameOfReference) {
|
|
45
54
|
frameOfReference = this._objects
|
|
46
55
|
}
|
|
@@ -71,7 +80,6 @@ class API {
|
|
|
71
80
|
|
|
72
81
|
mentions({ context, frameOfReference, useHierarchy=true, all, condition = (() => true) } = {}) {
|
|
73
82
|
const mentioned = frameOfReference?.mentioned || this._objects.mentioned
|
|
74
|
-
|
|
75
83
|
const findPrevious = !!context.stm_previous
|
|
76
84
|
const forAll = []
|
|
77
85
|
function addForAll(context) {
|
|
@@ -88,7 +96,7 @@ class API {
|
|
|
88
96
|
if (findPrevious && findCounter < 2) {
|
|
89
97
|
continue
|
|
90
98
|
}
|
|
91
|
-
if (condition()) {
|
|
99
|
+
if (condition(m)) {
|
|
92
100
|
if (all) {
|
|
93
101
|
allForAll(m)
|
|
94
102
|
} else {
|
|
@@ -162,19 +170,19 @@ class API {
|
|
|
162
170
|
}
|
|
163
171
|
}
|
|
164
172
|
|
|
165
|
-
getVariable(
|
|
166
|
-
if (!
|
|
173
|
+
getVariable(context) {
|
|
174
|
+
if (!context) {
|
|
167
175
|
return
|
|
168
176
|
}
|
|
169
|
-
let valueNew = this.mentions({ context
|
|
177
|
+
let valueNew = this.mentions({ context, useHierarchy: false, condition: (context) => context.isVariable })
|
|
170
178
|
if (valueNew && valueNew.value) {
|
|
171
179
|
valueNew = valueNew.value
|
|
172
180
|
}
|
|
173
181
|
return valueNew
|
|
174
182
|
}
|
|
175
183
|
|
|
176
|
-
setVariable(
|
|
177
|
-
this.mentioned({ context: { marker:
|
|
184
|
+
setVariable(variableName, value) {
|
|
185
|
+
this.mentioned({ context: { marker: variableName, isVariable: true }, value })
|
|
178
186
|
}
|
|
179
187
|
}
|
|
180
188
|
|
|
@@ -183,8 +191,9 @@ const api = new API()
|
|
|
183
191
|
const config = {
|
|
184
192
|
name: 'stm',
|
|
185
193
|
operators: [
|
|
186
|
-
"(
|
|
187
|
-
"(([memorable])
|
|
194
|
+
"(<stm_current|current> ([memorable]))",
|
|
195
|
+
"(<stm_previous|previous> ([memorable]))",
|
|
196
|
+
"(([memorable]) <stm_before|before>)",
|
|
188
197
|
"([remember] (memorable/*))",
|
|
189
198
|
],
|
|
190
199
|
words: {
|
|
@@ -213,8 +222,14 @@ const config = {
|
|
|
213
222
|
},
|
|
214
223
|
{
|
|
215
224
|
id: 'stm_previous',
|
|
225
|
+
isA: ['adjective'],
|
|
216
226
|
bridge: '{ ...after[0], modifiers: ["stm_previous"], stm_previous: operator, pullFromContext: true }',
|
|
217
227
|
},
|
|
228
|
+
{
|
|
229
|
+
id: 'stm_current',
|
|
230
|
+
isA: ['adjective'],
|
|
231
|
+
bridge: '{ ...after[0], modifiers: ["stm_current"], stm_current: operator, pullFromContext: true }',
|
|
232
|
+
},
|
|
218
233
|
{
|
|
219
234
|
id: 'stm_before',
|
|
220
235
|
isA: ['adjective'],
|
|
@@ -248,15 +263,15 @@ const config = {
|
|
|
248
263
|
}
|
|
249
264
|
|
|
250
265
|
function initializer({config}) {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
266
|
+
config.addArgs(({kms}) => ({
|
|
267
|
+
mentioned: (args) => {
|
|
268
|
+
kms.stm.api.mentioned(args)
|
|
269
|
+
},
|
|
270
|
+
mentions: (args) => {
|
|
271
|
+
return kms.stm.api.mentions(args)
|
|
272
|
+
},
|
|
273
|
+
}))
|
|
274
|
+
}
|
|
260
275
|
|
|
261
276
|
knowledgeModule( {
|
|
262
277
|
config,
|
|
@@ -271,7 +286,9 @@ knowledgeModule( {
|
|
|
271
286
|
contents: stm_tests,
|
|
272
287
|
checks: {
|
|
273
288
|
context: [defaultContextCheck({ extra: ['pullFromContext', 'stm_id'] })],
|
|
274
|
-
|
|
289
|
+
objects: [ { path: ['mentioned'] }],
|
|
290
|
+
// objects: [defaultContextCheck({ extra: ['mentioned'] })],
|
|
291
|
+
// objects: [{ property: 'mentioned', check: helpers.defaultContextCheckProperties }],
|
|
275
292
|
},
|
|
276
293
|
},
|
|
277
294
|
})
|