ekms 9.6.3 → 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.
- package/common/actions.instance.json +2771 -15
- package/common/actions.js +116 -8
- package/common/actions.test.json +79138 -384
- package/common/angle.instance.json +138 -834
- package/common/angle.test.json +172 -127
- package/common/animals.instance.json +260 -0
- package/common/articles.js +1 -2
- package/common/avatar.test.json +173 -33
- package/common/can.instance.json +40 -0
- package/common/colors.instance.json +308 -0
- package/common/comparable.instance.json +120 -0
- package/common/compass.instance.json +63 -18
- package/common/concept.js +2 -1
- package/common/conjunction.js +11 -17
- package/common/control.js +42 -0
- package/common/control.test.json +2 -0
- package/common/crew.instance.json +520 -0
- package/common/dates.instance.json +184 -0
- package/common/dialogues.js +3 -3
- package/common/dimension.instance.json +264 -69
- package/common/dimension.js +5 -5
- package/common/dimension.test.json +545 -441
- package/common/drone.instance.json +15927 -2638
- package/common/drone.js +359 -71
- package/common/drone.test.json +587651 -44132
- package/common/drone_v1.instance.json +492 -59
- package/common/drone_v1.js +9 -9
- package/common/edible.instance.json +696 -0
- package/common/emotions.instance.json +20 -0
- package/common/evaluate.js +1 -1
- package/common/fastfood.instance.json +1310 -216
- package/common/fastfood.js +1 -1
- package/common/formulas.instance.json +20 -5
- package/common/formulas.js +1 -1
- package/common/gdefaults.js +32 -5
- package/common/help.test.json +23 -3
- 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 +11 -6
- package/common/hierarchy.js +2 -0
- package/common/kirk.instance.json +20 -0
- package/common/length.instance.json +1117 -5708
- package/common/length.test.json +29761 -12488
- package/common/logging.js +41 -0
- package/common/logging.test.json +2 -0
- package/common/math.instance.json +30 -12
- package/common/math.js +6 -5
- package/common/menus.instance.json +140 -35
- package/common/meta.js +1 -1
- package/common/nameable.js +7 -9
- package/common/nameable.test.json +252 -150
- package/common/ordering.instance.json +40 -0
- package/common/ordinals.js +51 -5
- package/common/people.instance.json +160 -0
- package/common/pipboy.instance.json +396 -85
- package/common/pipboy.js +1 -1
- package/common/pokemon.instance.json +260 -0
- package/common/pressure.instance.json +108 -370
- package/common/properties.instance.json +20 -0
- package/common/properties.js +5 -4
- package/common/properties.test.json +2754 -2142
- package/common/rates.instance.json +1 -1
- package/common/rates.js +3 -3
- package/common/rates.test.json +6914 -2428
- package/common/reminders.js +1 -1
- package/common/reports.instance.json +49 -176
- package/common/reports.js +2 -2
- package/common/scorekeeper.js +1 -1
- package/common/sdefaults.js +18 -5
- package/common/spock.instance.json +20 -0
- package/common/stm.js +115 -53
- package/common/stm.test.json +2670 -54
- package/common/temperature.instance.json +709 -2284
- package/common/time.instance.json +14333 -2220
- package/common/time.js +48 -2
- package/common/time.test.json +13239 -0
- package/common/tokenize.js +2 -0
- package/common/ui.instance.json +20 -5
- package/common/ui.js +1 -1
- package/common/weight.instance.json +621 -1886
- package/common/wp.instance.json +336 -70
- package/main.js +4 -0
- 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,18 +62,23 @@ 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",
|
|
66
78
|
{
|
|
67
79
|
operators: [
|
|
68
80
|
"([thenTime|then])",
|
|
81
|
+
"([repeatable])",
|
|
69
82
|
"(([timePoint]) [ampm|])",
|
|
70
83
|
"(([integer]) [timeRepeats|] ([timePoint]))",
|
|
71
84
|
"([atTime|at] (timePoint))",
|
|
@@ -74,17 +87,35 @@ const template = {
|
|
|
74
87
|
"([hourMinutes|] (integer) (colon) (integer))",
|
|
75
88
|
],
|
|
76
89
|
bridges: [
|
|
90
|
+
{
|
|
91
|
+
id: 'repeatable',
|
|
92
|
+
check: defaultContextCheckProperties(['repeats'])
|
|
93
|
+
},
|
|
77
94
|
{
|
|
78
95
|
id: 'thenTime',
|
|
79
96
|
after: ['verb'],
|
|
80
97
|
},
|
|
81
98
|
{
|
|
82
99
|
id: 'timeRepeats',
|
|
100
|
+
level: 0,
|
|
83
101
|
before: ['verb'],
|
|
84
102
|
convolution: true,
|
|
85
|
-
bridge: "{ ...next(operator), repeats: before[0], time: after[0], interpolate: '
|
|
103
|
+
bridge: "{ ...next(operator), repeats: before[0], time: after[0], interpolate: [{ property: 'repeats' }, { property: 'time' }] }",
|
|
86
104
|
check: defaultContextCheckProperties(['time', 'repeats'])
|
|
87
105
|
},
|
|
106
|
+
{
|
|
107
|
+
id: 'timeRepeats',
|
|
108
|
+
level: 1,
|
|
109
|
+
before: ['verb'],
|
|
110
|
+
bridge: "{ ...repeatable, repeats: operator, checks: append(repeatable.checks, ['repeats']), repeatable: repeatable, interpolate: [{ property: 'repeatable' }, { property: 'repeats', byPosition: true }] }",
|
|
111
|
+
selector: {
|
|
112
|
+
loose: "repeatable",
|
|
113
|
+
arguments: {
|
|
114
|
+
repeatable: "(@<= 'repeatable')",
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
check: defaultContextCheckProperties(['time', 'repeats']),
|
|
118
|
+
},
|
|
88
119
|
{
|
|
89
120
|
id: 'hourMinutes',
|
|
90
121
|
isA: ['timePoint'],
|
|
@@ -164,6 +195,21 @@ const template = {
|
|
|
164
195
|
],
|
|
165
196
|
|
|
166
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
|
+
},
|
|
167
213
|
{
|
|
168
214
|
notes: 'evaluate time',
|
|
169
215
|
where: where(),
|