tpmkms_4wp 9.3.0-beta.6 → 9.3.0-beta.7
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/concept.test.json +279 -193
- package/common/crew.instance.json +72 -0
- package/common/dialogues.js +5 -2
- package/common/events.js +1 -1
- package/common/fastfood.instance.json +296 -108
- package/common/fastfood.test.json +16291 -6597
- package/common/helpers.js +24 -7
- package/common/numbers.js +1 -1
- package/common/numbers.test.json +89 -23
- package/common/percentages.js +1 -1
- package/common/pipboy.test.json +4377 -3386
- package/common/reminders.instance.json +24 -4
- package/common/reminders.js +17 -26
- package/common/reminders.test.json +6819 -6
- package/common/reports.instance.json +2 -2
- package/common/scorekeeper.test.json +3565 -7550
- package/common/time.js +68 -30
- package/common/time.test.json +4124 -124
- package/common/ui.js +3 -1
- package/common/weight.instance.json +0 -52
- package/common/wp.test.json +8057 -3867
- package/package.json +2 -2
@@ -2,8 +2,9 @@
|
|
2
2
|
"configs": [
|
3
3
|
{
|
4
4
|
"operators": [
|
5
|
-
"([remind] (self/*) (*)*)",
|
6
5
|
"([reminderTime|])",
|
6
|
+
"([remind] (self/*) (!@<= 'onDate')*)",
|
7
|
+
"([remind:withTimeBridge] (self/*) (!@<= 'onDate')* ([onDate|on] (reminderTime)))",
|
7
8
|
"([show] ([reminders]))",
|
8
9
|
"([delete_reminders|delete,cancel] (number/*))"
|
9
10
|
],
|
@@ -14,14 +15,23 @@
|
|
14
15
|
"verb"
|
15
16
|
],
|
16
17
|
"bridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], interpolate: '${operator} ${who} ${reminder}' }",
|
17
|
-
"
|
18
|
+
"withTimeBridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], when: after[2], interpolate: '${operator} ${who} ${reminder} ${when}' }",
|
19
|
+
"semantic": "async ({api, gsp, context}) => {\n const text = await gsp(context.reminder.slice(1));\n api.add({ text, when: context.when });\n }"
|
18
20
|
},
|
19
21
|
{
|
20
22
|
"id": "reminderTime",
|
21
23
|
"children": [
|
24
|
+
"day_dates",
|
22
25
|
"month_dates"
|
23
26
|
]
|
24
27
|
},
|
28
|
+
{
|
29
|
+
"id": "onDate",
|
30
|
+
"isA": [
|
31
|
+
"preposition"
|
32
|
+
],
|
33
|
+
"bridge": "{ ...next(operator), time: after[0], onDate: operator, interpolate: '${onDate} ${time}' }"
|
34
|
+
},
|
25
35
|
{
|
26
36
|
"id": "reminders",
|
27
37
|
"isA": [
|
@@ -54,8 +64,9 @@
|
|
54
64
|
{
|
55
65
|
"extraConfig": true,
|
56
66
|
"operators": [
|
57
|
-
"([remind] (self/*) (*)*)",
|
58
67
|
"([reminderTime|])",
|
68
|
+
"([remind] (self/*) (!@<= 'onDate')*)",
|
69
|
+
"([remind:withTimeBridge] (self/*) (!@<= 'onDate')* ([onDate|on] (reminderTime)))",
|
59
70
|
"([show] ([reminders]))",
|
60
71
|
"([delete_reminders|delete,cancel] (number/*))"
|
61
72
|
],
|
@@ -65,14 +76,23 @@
|
|
65
76
|
"isA": [
|
66
77
|
"verb"
|
67
78
|
],
|
68
|
-
"bridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], interpolate: '${operator} ${who} ${reminder}' }"
|
79
|
+
"bridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], interpolate: '${operator} ${who} ${reminder}' }",
|
80
|
+
"withTimeBridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], when: after[2], interpolate: '${operator} ${who} ${reminder} ${when}' }"
|
69
81
|
},
|
70
82
|
{
|
71
83
|
"id": "reminderTime",
|
72
84
|
"children": [
|
85
|
+
"day_dates",
|
73
86
|
"month_dates"
|
74
87
|
]
|
75
88
|
},
|
89
|
+
{
|
90
|
+
"id": "onDate",
|
91
|
+
"isA": [
|
92
|
+
"preposition"
|
93
|
+
],
|
94
|
+
"bridge": "{ ...next(operator), time: after[0], onDate: operator, interpolate: '${onDate} ${time}' }"
|
95
|
+
},
|
76
96
|
{
|
77
97
|
"id": "reminders",
|
78
98
|
"isA": [
|
package/common/reminders.js
CHANGED
@@ -4,6 +4,7 @@ const reminders_tests = require('./reminders.test.json')
|
|
4
4
|
const reminders_instance = require('./reminders.instance.json')
|
5
5
|
const selfKM = require('./self')
|
6
6
|
const dates = require('./dates')
|
7
|
+
const time = require('./time')
|
7
8
|
const helpers = require('./helpers')
|
8
9
|
|
9
10
|
class API {
|
@@ -21,7 +22,7 @@ class API {
|
|
21
22
|
askAbout() {
|
22
23
|
const items = []
|
23
24
|
for (const item of this._objects.reminders) {
|
24
|
-
if (!item.
|
25
|
+
if (!item.date) {
|
25
26
|
items.push({ when: true, text: item.text, id: item.id })
|
26
27
|
}
|
27
28
|
}
|
@@ -67,8 +68,11 @@ const template = {
|
|
67
68
|
configs: [
|
68
69
|
{
|
69
70
|
operators: [
|
70
|
-
"([remind] (self/*) (*)*)",
|
71
71
|
"([reminderTime|])",
|
72
|
+
"([remind] (self/*) (!@<= 'onDate')*)",
|
73
|
+
"([onDate|on] (reminderTime))",
|
74
|
+
"([remind:withDateBridge] (self/*) (!@<= 'onDate')* (onDate))",
|
75
|
+
"([remind:withDateAndTimeBridge] (self/*) (!@<= 'onDate')* (onDate) (atTime))",
|
72
76
|
"([show] ([reminders]))",
|
73
77
|
"([delete_reminders|delete,cancel] (number/*))",
|
74
78
|
],
|
@@ -77,9 +81,11 @@ const template = {
|
|
77
81
|
id: 'remind',
|
78
82
|
isA: ['verb'],
|
79
83
|
bridge: "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], interpolate: '${operator} ${who} ${reminder}' }",
|
84
|
+
withDateBridge: "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], date: after[2], interpolate: '${operator} ${who} ${reminder} ${date}' }",
|
85
|
+
withDateAndTimeBridge: "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], date: after[2], time: after[3], interpolate: '${operator} ${who} ${reminder} ${date} ${time}' }",
|
80
86
|
semantic: async ({api, gsp, context}) => {
|
81
87
|
const text = await gsp(context.reminder.slice(1));
|
82
|
-
api.add({ text });
|
88
|
+
api.add({ text, date: context.date, time: context.time });
|
83
89
|
},
|
84
90
|
},
|
85
91
|
{
|
@@ -89,6 +95,11 @@ const template = {
|
|
89
95
|
'month_dates',
|
90
96
|
],
|
91
97
|
},
|
98
|
+
{
|
99
|
+
id: 'onDate',
|
100
|
+
isA: ['preposition'],
|
101
|
+
bridge: "{ ...next(operator), date: after[0], onDate: operator, interpolate: '${onDate} ${date}' }",
|
102
|
+
},
|
92
103
|
{
|
93
104
|
id: 'reminders',
|
94
105
|
isA: ['noun'],
|
@@ -138,7 +149,6 @@ const template = {
|
|
138
149
|
},
|
139
150
|
|
140
151
|
matchr: ({ isA, api, context }) => {
|
141
|
-
debugger
|
142
152
|
if (isA(context.marker, 'reminderTime') && api.askAbout().length > 0) {
|
143
153
|
return true
|
144
154
|
}
|
@@ -146,26 +156,7 @@ const template = {
|
|
146
156
|
},
|
147
157
|
applyr: ({ context, api }) => {
|
148
158
|
const items = api.askAbout()
|
149
|
-
|
150
|
-
api.update({ id: items[0].id, when: context })
|
151
|
-
// TODO check for is available for all modifications
|
152
|
-
/*
|
153
|
-
const needsDrink = askAbout(args)
|
154
|
-
const { api, context } = args
|
155
|
-
if (isMany(context)) {
|
156
|
-
let count = getCount(context) || Number.MAX_SAFE_INTEGER
|
157
|
-
for (const item of needsDrink) {
|
158
|
-
if (count < 1) {
|
159
|
-
break
|
160
|
-
}
|
161
|
-
count -= 1
|
162
|
-
api.addDrink(item.item_id, { id: context.value })
|
163
|
-
}
|
164
|
-
} else {
|
165
|
-
const item_id = needsDrink[0].item_id
|
166
|
-
api.addDrink(item_id, { id: context.value })
|
167
|
-
}
|
168
|
-
*/
|
159
|
+
api.update({ id: items[0].id, date: context })
|
169
160
|
}
|
170
161
|
},
|
171
162
|
])
|
@@ -175,7 +166,7 @@ const template = {
|
|
175
166
|
|
176
167
|
knowledgeModule( {
|
177
168
|
config: { name: 'reminders' },
|
178
|
-
includes: [dates, selfKM],
|
169
|
+
includes: [time, dates, selfKM],
|
179
170
|
api: () => new API(),
|
180
171
|
|
181
172
|
module,
|
@@ -188,7 +179,7 @@ knowledgeModule( {
|
|
188
179
|
objects: [
|
189
180
|
{
|
190
181
|
property: 'reminders',
|
191
|
-
filter: [ 'text', '
|
182
|
+
filter: [ 'text', 'date', 'time' ],
|
192
183
|
}
|
193
184
|
],
|
194
185
|
},
|