ekms 9.6.3-beta.9 → 9.7.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 (74) hide show
  1. package/common/actions.instance.json +2767 -13
  2. package/common/actions.js +112 -5
  3. package/common/actions.test.json +79138 -384
  4. package/common/angle.instance.json +138 -834
  5. package/common/angle.test.json +172 -127
  6. package/common/animals.instance.json +260 -0
  7. package/common/articles.js +1 -2
  8. package/common/avatar.test.json +173 -33
  9. package/common/can.instance.json +40 -0
  10. package/common/colors.instance.json +280 -0
  11. package/common/comparable.instance.json +120 -0
  12. package/common/compass.instance.json +63 -18
  13. package/common/concept.js +2 -1
  14. package/common/conjunction.js +11 -17
  15. package/common/control.js +42 -0
  16. package/common/control.test.json +2 -0
  17. package/common/crew.instance.json +520 -0
  18. package/common/dates.instance.json +100 -0
  19. package/common/dimension.instance.json +264 -69
  20. package/common/dimension.js +2 -2
  21. package/common/dimension.test.json +545 -441
  22. package/common/drone.instance.json +9101 -794
  23. package/common/drone.js +257 -68
  24. package/common/drone.test.json +415672 -38730
  25. package/common/drone_v1.instance.json +462 -57
  26. package/common/edible.instance.json +640 -0
  27. package/common/emotions.instance.json +20 -0
  28. package/common/evaluate.js +1 -1
  29. package/common/fastfood.instance.json +1310 -176
  30. package/common/formulas.instance.json +20 -5
  31. package/common/formulas.js +1 -1
  32. package/common/gdefaults.js +19 -3
  33. package/common/help.test.json +23 -3
  34. package/common/helpers/conjunction.js +2 -0
  35. package/common/helpers/formulas.js +6 -0
  36. package/common/helpers/properties.js +9 -7
  37. package/common/helpers.js +11 -6
  38. package/common/hierarchy.js +2 -0
  39. package/common/kirk.instance.json +20 -0
  40. package/common/length.instance.json +1117 -5708
  41. package/common/length.test.json +29761 -12488
  42. package/common/logging.js +41 -0
  43. package/common/logging.test.json +2 -0
  44. package/common/math.instance.json +30 -12
  45. package/common/math.js +6 -5
  46. package/common/menus.instance.json +140 -35
  47. package/common/meta.js +1 -1
  48. package/common/nameable.js +0 -2
  49. package/common/nameable.test.json +252 -150
  50. package/common/ordering.instance.json +40 -0
  51. package/common/people.instance.json +160 -0
  52. package/common/pipboy.instance.json +340 -85
  53. package/common/pokemon.instance.json +260 -0
  54. package/common/pressure.instance.json +108 -370
  55. package/common/properties.instance.json +20 -0
  56. package/common/properties.js +2 -1
  57. package/common/properties.test.json +2754 -2142
  58. package/common/rates.test.json +6914 -2428
  59. package/common/reports.instance.json +49 -176
  60. package/common/sdefaults.js +18 -5
  61. package/common/spock.instance.json +20 -0
  62. package/common/stm.js +95 -12
  63. package/common/stm.test.json +2670 -54
  64. package/common/temperature.instance.json +709 -2284
  65. package/common/time.instance.json +14241 -2228
  66. package/common/time.js +30 -3
  67. package/common/time.test.json +9914 -0
  68. package/common/tokenize.js +2 -0
  69. package/common/ui.instance.json +20 -5
  70. package/common/ui.js +1 -1
  71. package/common/weight.instance.json +621 -1886
  72. package/common/wp.instance.json +280 -70
  73. package/main.js +4 -0
  74. package/package.json +11 -5
package/common/time.js CHANGED
@@ -43,6 +43,14 @@ class API {
43
43
  }
44
44
  }
45
45
 
46
+ async sleep(ms) {
47
+ if (this.args.isProcess || this.args.isTest) {
48
+ await this.args.testLog(`sleep(${ms})`)
49
+ } else {
50
+ await new Promise(r => setTimeout(r, ms));
51
+ }
52
+ }
53
+
46
54
  newDate() {
47
55
  return new Date()
48
56
  }
@@ -54,12 +62,16 @@ class API {
54
62
 
55
63
  const template = {
56
64
  configs: [
57
- "years hours minutes and seconds are units of time",
65
+ "years hours minutes milliseconds and seconds are units of time",
58
66
  "hours = minutes / 60",
59
67
  "minutes = hours * 60",
60
68
  "seconds = minutes * 60",
61
69
  "hours = seconds / 3600",
62
70
  "seconds = hours * 3600",
71
+ "milliseconds = minutes * 60 * 1000",
72
+ "minutes = milliseconds / 1000 / 60",
73
+ "milliseconds = seconds * 1000",
74
+ "seconds = milliseconds / 1000",
63
75
  "minutes = seconds / 60",
64
76
  "day = hours / 24",
65
77
  "hours = days * 24",
@@ -88,7 +100,7 @@ const template = {
88
100
  level: 0,
89
101
  before: ['verb'],
90
102
  convolution: true,
91
- bridge: "{ ...next(operator), repeats: before[0], time: after[0], interpolate: '${repeats} ${time}' }",
103
+ bridge: "{ ...next(operator), repeats: before[0], time: after[0], interpolate: [{ property: 'repeats' }, { property: 'time' }] }",
92
104
  check: defaultContextCheckProperties(['time', 'repeats'])
93
105
  },
94
106
  {
@@ -102,7 +114,7 @@ const template = {
102
114
  repeatable: "(@<= 'repeatable')",
103
115
  },
104
116
  },
105
- check: defaultContextCheckProperties(['time', 'repeats'])
117
+ check: defaultContextCheckProperties(['time', 'repeats']),
106
118
  },
107
119
  {
108
120
  id: 'hourMinutes',
@@ -183,6 +195,21 @@ const template = {
183
195
  ],
184
196
 
185
197
  semantics: [
198
+ {
199
+ where: where(),
200
+ priority: -1,
201
+ match: (args) => args.callOnce(args, ({context}) => context.repeats) && args.context.repeats?.repeats,
202
+ apply: async ({context, e, s, handlerStack}) => {
203
+ const v = (await e(context.repeats.repeats)).evalue
204
+ for (let i = 0; i < v; ++i) {
205
+ if (context.action) {
206
+ await s(context.action)
207
+ } else {
208
+ await s({ ...context, repeats: undefined })
209
+ }
210
+ }
211
+ }
212
+ },
186
213
  {
187
214
  notes: 'evaluate time',
188
215
  where: where(),