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.
Files changed (114) hide show
  1. package/common/animals.instance.json +130 -0
  2. package/common/animals.js +3 -5
  3. package/common/asking.js +12 -4
  4. package/common/avatar.test.json +1001 -860
  5. package/common/can.instance.json +2182 -5
  6. package/common/can.js +102 -39
  7. package/common/can.test.json +51307 -0
  8. package/common/colors.instance.json +142 -30
  9. package/common/colors.js +3 -6
  10. package/common/comparable.instance.json +31 -1
  11. package/common/comparable.js +3 -6
  12. package/common/concept.js +25 -27
  13. package/common/concept.test.json +142 -120
  14. package/common/conjunction.test.json +32 -42
  15. package/common/crew.instance.json +400 -126
  16. package/common/crew.js +3 -6
  17. package/common/dateTimeSelectors.instance.json +2 -2
  18. package/common/dateTimeSelectors.js +6 -9
  19. package/common/dateTimeSelectors.test.json +76935 -35739
  20. package/common/dates.instance.json +50 -84
  21. package/common/dates.js +3 -6
  22. package/common/dates.test.json +284 -287
  23. package/common/dialogues.js +33 -115
  24. package/common/dialogues.test.json +1248 -1152
  25. package/common/dimension.instance.json +21498 -566
  26. package/common/dimension.js +147 -52
  27. package/common/dimension.test.json +10979 -4625
  28. package/common/drone.instance.json +24709 -0
  29. package/common/drone.js +662 -0
  30. package/common/drone.test.json +30522 -0
  31. package/common/drone_v1.instance.json +24703 -0
  32. package/common/drone_v1.js +596 -0
  33. package/common/drone_v1.test.json +115538 -0
  34. package/common/edible.instance.json +365 -65
  35. package/common/edible.js +3 -5
  36. package/common/emotions.instance.json +57 -70
  37. package/common/emotions.js +3 -6
  38. package/common/errors.js +3 -3
  39. package/common/fastfood.instance.json +1270 -244
  40. package/common/fastfood.js +10 -12
  41. package/common/fastfood.test.json +6970 -6829
  42. package/common/formulas.instance.json +10 -0
  43. package/common/formulas.js +2 -1
  44. package/common/gdefaults.js +58 -13
  45. package/common/help.js +9 -9
  46. package/common/help.test.json +65 -11
  47. package/common/helpers/dialogues.js +9 -1
  48. package/common/helpers/properties.js +37 -18
  49. package/common/helpers.js +32 -2
  50. package/common/hierarchy.js +10 -8
  51. package/common/kirk.instance.json +10 -0
  52. package/common/kirk.js +4 -6
  53. package/common/kirk.test.json +600 -424
  54. package/common/latin.instance.json +10 -10
  55. package/common/latin.js +8 -10
  56. package/common/length.instance.json +34659 -3157
  57. package/common/length.js +11 -6
  58. package/common/length.test.json +54357 -2557
  59. package/common/math.instance.json +11 -1
  60. package/common/math.js +2 -1
  61. package/common/menus.instance.json +74 -7
  62. package/common/menus.js +3 -12
  63. package/common/meta.js +4 -5
  64. package/common/nameable.js +29 -15
  65. package/common/nameable.test.json +436 -0
  66. package/common/numbers.js +1 -1
  67. package/common/ordering.instance.json +24 -2
  68. package/common/ordering.js +3 -5
  69. package/common/ordering.test.json +104 -174
  70. package/common/people.instance.json +140 -315
  71. package/common/people.js +3 -5
  72. package/common/pipboy.instance.json +171 -57
  73. package/common/pipboy.js +2 -1
  74. package/common/pokemon.instance.json +135 -5
  75. package/common/pokemon.js +3 -5
  76. package/common/pressure.instance.json +3990 -1981
  77. package/common/pressure.js +3 -5
  78. package/common/pressure.test.json +433 -477
  79. package/common/properties.instance.json +15 -16
  80. package/common/properties.js +10 -9
  81. package/common/properties.test.json +9565 -6951
  82. package/common/rates.instance.json +59 -0
  83. package/common/rates.js +95 -0
  84. package/common/rates.test.json +27702 -0
  85. package/common/reminders.js +5 -8
  86. package/common/reminders.test.json +64635 -25787
  87. package/common/reports.instance.json +22 -2
  88. package/common/reports.js +3 -5
  89. package/common/scorekeeper.js +3 -6
  90. package/common/spock.instance.json +10 -0
  91. package/common/spock.js +4 -7
  92. package/common/spock.test.json +606 -430
  93. package/common/stm.js +37 -20
  94. package/common/temperature.instance.json +3162 -1153
  95. package/common/temperature.js +3 -5
  96. package/common/temperature.test.json +433 -477
  97. package/common/time.instance.json +24852 -0
  98. package/common/time.js +136 -139
  99. package/common/time.test.json +31876 -3757
  100. package/common/ui.instance.json +12 -5
  101. package/common/ui.js +4 -13
  102. package/common/weight.instance.json +10500 -4098
  103. package/common/weight.js +3 -5
  104. package/common/weight.test.json +2601 -2263
  105. package/common/words.instance.json +9 -0
  106. package/common/words.js +50 -0
  107. package/common/words.test.json +2 -0
  108. package/common/wp.instance.json +470 -58
  109. package/common/wp.js +6 -4
  110. package/common/wp.test.json +7385 -6906
  111. package/main.js +6 -2
  112. package/package.json +21 -6
  113. package/common/listener.js +0 -50
  114. 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({ context:concept, value=null, frameOfReference } = {}) {
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(name) {
166
- if (!name) {
173
+ getVariable(context) {
174
+ if (!context) {
167
175
  return
168
176
  }
169
- let valueNew = this.mentions({ context: { marker: name, value: name }, useHierarchy: false }) || name
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(name, value) {
177
- this.mentioned({ context: { marker: name }, value })
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
- "([stm_previous|previous] ([memorable]))",
187
- "(([memorable]) [stm_before|before])",
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
- config.addArgs(({kms}) => ({
252
- mentioned: (args) => {
253
- kms.stm.api.mentioned(args)
254
- },
255
- mentions: (args) => {
256
- return kms.stm.api.mentions(args)
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
- objects: [{ property: 'mentioned', filter: helpers.defaultContextCheckProperties }],
289
+ objects: [ { path: ['mentioned'] }],
290
+ // objects: [defaultContextCheck({ extra: ['mentioned'] })],
291
+ // objects: [{ property: 'mentioned', check: helpers.defaultContextCheckProperties }],
275
292
  },
276
293
  },
277
294
  })