tpmkms_4wp 9.3.0-beta.9 → 9.4.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 +0 -65
- package/common/animals.js +2 -3
- package/common/animals.test.json +1607 -1
- package/common/articles.js +2 -4
- package/common/asking.js +21 -5
- package/common/avatar.js +2 -2
- package/common/characters.js +2 -2
- package/common/colors.instance.json +28 -70
- package/common/colors.js +2 -2
- package/common/comparable.instance.json +0 -15
- package/common/comparable.js +2 -2
- package/common/concept.js +1 -2
- package/common/conjunction.js +3 -5
- package/common/countable.js +2 -14
- package/common/crew.instance.json +0 -130
- package/common/crew.js +2 -2
- package/common/currency.js +2 -3
- package/common/dateTimeSelectors.instance.json +175 -0
- package/common/dateTimeSelectors.js +168 -0
- package/common/dateTimeSelectors.test.json +85622 -0
- package/common/dates.instance.json +538 -506
- package/common/dates.js +112 -15
- package/common/dates.test.json +11021 -514
- package/common/dialogues.js +8 -47
- package/common/dimension.instance.json +0 -5
- package/common/dimension.js +4 -4
- package/common/edible.instance.json +56 -160
- package/common/edible.js +2 -2
- package/common/emotions.instance.json +0 -5
- package/common/emotions.js +2 -2
- package/common/errors.js +3 -0
- package/common/evaluate.js +2 -2
- package/common/events.js +1 -2
- package/common/fastfood.instance.json +262 -713
- package/common/fastfood.js +2 -4
- package/common/formulas.instance.json +0 -5
- package/common/formulas.js +3 -1
- package/common/gdefaults.js +2 -3
- package/common/help.js +2 -2
- package/common/helpers/dateTimeSelectors.js +198 -0
- package/common/helpers/dialogues.js +11 -8
- package/common/helpers/properties.js +2 -2
- package/common/helpers.js +22 -63
- package/common/hierarchy.js +12 -13
- package/common/javascript.js +2 -3
- package/common/kirk.instance.json +0 -5
- package/common/kirk.js +2 -3
- package/common/length.instance.json +0 -75
- package/common/length.js +2 -3
- package/common/listener.js +3 -1
- package/common/math.instance.json +0 -5
- package/common/math.js +2 -3
- package/common/menus.instance.json +0 -35
- package/common/menus.js +3 -1
- package/common/meta.js +4 -5
- package/common/nameable.js +3 -1
- package/common/negation.js +2 -2
- package/common/numbers.js +6 -3
- package/common/ordering.instance.json +0 -10
- package/common/ordering.js +2 -3
- package/common/ordinals.js +2 -3
- package/common/people.instance.json +0 -40
- package/common/people.js +2 -3
- package/common/percentages.js +2 -3
- package/common/percentages.test.json +57 -11
- package/common/pipboy.instance.json +84 -85
- package/common/pipboy.js +1 -1
- package/common/pokemon.instance.json +0 -65
- package/common/pokemon.js +1 -2
- package/common/pos.js +2 -2
- package/common/pressure.instance.json +0 -20
- package/common/pressure.js +2 -2
- package/common/properties.instance.json +0 -5
- package/common/properties.js +11 -13
- package/common/punctuation.js +2 -2
- package/common/reminders.instance.json +145 -35
- package/common/reminders.js +264 -82
- package/common/reminders.test.json +69523 -970
- package/common/reports.instance.json +2 -12
- package/common/reports.js +1 -1
- package/common/scorekeeper.js +2 -2
- package/common/sdefaults.js +1 -1
- package/common/self.js +1 -1
- package/common/sizeable.js +2 -2
- package/common/spock.instance.json +0 -5
- package/common/spock.js +1 -1
- package/common/stgame.js +1 -1
- package/common/stm.js +1 -1
- package/common/tell.js +2 -2
- package/common/temperature.instance.json +84 -20
- package/common/temperature.js +2 -2
- package/common/tester.js +0 -1
- package/common/testing.js +0 -1
- package/common/time.js +10 -8
- package/common/time.test.json +73 -119
- package/common/tokenize.js +1 -1
- package/common/ui.instance.json +0 -5
- package/common/ui.js +1 -1
- package/common/weight.instance.json +0 -60
- package/common/weight.js +2 -2
- package/common/wp.instance.json +56 -70
- package/common/wp.js +1 -3
- package/common/yesno.js +2 -2
- package/main.js +2 -0
- package/package.json +8 -4
- package/common/helpers/reminders.js +0 -48
@@ -243,11 +243,6 @@
|
|
243
243
|
"article",
|
244
244
|
false
|
245
245
|
],
|
246
|
-
[
|
247
|
-
"evaluate",
|
248
|
-
"verb",
|
249
|
-
false
|
250
|
-
],
|
251
246
|
[
|
252
247
|
"every",
|
253
248
|
"article",
|
@@ -1675,11 +1670,6 @@
|
|
1675
1670
|
"article",
|
1676
1671
|
false
|
1677
1672
|
],
|
1678
|
-
[
|
1679
|
-
"evaluate",
|
1680
|
-
"verb",
|
1681
|
-
false
|
1682
|
-
],
|
1683
1673
|
[
|
1684
1674
|
"every",
|
1685
1675
|
"article",
|
@@ -3635,11 +3625,6 @@
|
|
3635
3625
|
"article",
|
3636
3626
|
false
|
3637
3627
|
],
|
3638
|
-
[
|
3639
|
-
"evaluate",
|
3640
|
-
"verb",
|
3641
|
-
false
|
3642
|
-
],
|
3643
3628
|
[
|
3644
3629
|
"every",
|
3645
3630
|
"article",
|
@@ -5311,11 +5296,6 @@
|
|
5311
5296
|
"article",
|
5312
5297
|
false
|
5313
5298
|
],
|
5314
|
-
[
|
5315
|
-
"evaluate",
|
5316
|
-
"verb",
|
5317
|
-
false
|
5318
|
-
],
|
5319
5299
|
[
|
5320
5300
|
"every",
|
5321
5301
|
"article",
|
package/common/pressure.js
CHANGED
package/common/properties.js
CHANGED
@@ -432,9 +432,9 @@ const config = {
|
|
432
432
|
{
|
433
433
|
where: where(),
|
434
434
|
match: ({context}) => context.marker == 'concept' && context.same,
|
435
|
-
apply: (args) => {
|
435
|
+
apply: async (args) => {
|
436
436
|
const {context} = args
|
437
|
-
args.makeObject({ ...args, context: context.same })
|
437
|
+
await args.makeObject({ ...args, context: context.same })
|
438
438
|
context.sameWasProcessed = true
|
439
439
|
}
|
440
440
|
},
|
@@ -550,8 +550,8 @@ const config = {
|
|
550
550
|
const propertyContext = context;
|
551
551
|
const objectId = context.object.value
|
552
552
|
|
553
|
-
api.makeObject({ ...args, context: objectContext })
|
554
|
-
api.makeObject({ ...args, context: propertyContext })
|
553
|
+
await api.makeObject({ ...args, context: objectContext })
|
554
|
+
await api.makeObject({ ...args, context: propertyContext })
|
555
555
|
// const propertyId = context.value
|
556
556
|
/*
|
557
557
|
const propertyId = context.marker
|
@@ -695,15 +695,13 @@ knowledgeModule( {
|
|
695
695
|
name: './properties.test.json',
|
696
696
|
contents: properties_tests,
|
697
697
|
checks: {
|
698
|
-
context:
|
699
|
-
|
700
|
-
|
701
|
-
'
|
702
|
-
'
|
703
|
-
|
704
|
-
|
705
|
-
]
|
706
|
-
*/
|
698
|
+
context: [
|
699
|
+
defaultContextCheck({ marker: 'property', exported: true, extra: ['object', 'objects'] }),
|
700
|
+
defaultContextCheck({ marker: 'possession', exported: true, extra: ['object', 'objects'] }),
|
701
|
+
defaultContextCheck({ marker: 'propertyOf', exported: true, extra: ['object', 'objects'] }),
|
702
|
+
defaultContextCheck({ marker: 'objectPrefix', exported: true, extra: ['object', 'objects'] }),
|
703
|
+
defaultContextCheck()
|
704
|
+
],
|
707
705
|
},
|
708
706
|
include: {
|
709
707
|
words: true,
|
package/common/punctuation.js
CHANGED
@@ -2,35 +2,94 @@
|
|
2
2
|
"configs": [
|
3
3
|
{
|
4
4
|
"operators": [
|
5
|
-
"([
|
6
|
-
|
7
|
-
|
5
|
+
"([remindable])",
|
6
|
+
{
|
7
|
+
"pattern": "([addRemindable] (word)*)",
|
8
|
+
"development": true
|
9
|
+
},
|
10
|
+
"([remind:justWhoBridge] (remindable/*))",
|
11
|
+
"([remind] (remindable/*) (!@<= 'dateTimeSelector' && !@<= 'inAddition')*)",
|
12
|
+
"([remind:withDateBridge] (remindable/*) (!@<= 'dateTimeSelector' && !@<= 'inAddition')* (dateTimeSelector))",
|
13
|
+
"([remind:withDateFirstBridge] (remindable/*) (dateTimeSelector) (!@<= 'dateTimeSelector' && !@<= 'inAddition')*)",
|
14
|
+
"([remind:withDateAndTimeBridge] (remindable/*) (!@<= 'dateTimeSelector' && !@<= 'inAddition')* (dateTimeSelector) (atTime))",
|
15
|
+
"([remindResponse] (!@<= 'remindResponse' && !@<= 'dateTimeSelector' && !@<= 'inAddition')+ (dateTimeSelector))",
|
8
16
|
"([show] ([reminders]))",
|
9
|
-
"([delete_reminders|delete,cancel] (number/*))"
|
17
|
+
"([delete_reminders|delete,cancel] (number/*))",
|
18
|
+
"([add] (remindable/*))",
|
19
|
+
"([remove|] (remindable/*))",
|
20
|
+
"((verb/*) [inAddition|also,too])"
|
10
21
|
],
|
11
22
|
"bridges": [
|
12
23
|
{
|
13
|
-
"id": "
|
24
|
+
"id": "inAddition",
|
25
|
+
"after": [
|
26
|
+
"verb"
|
27
|
+
],
|
28
|
+
"bridge": "{ ...before[0], inAddition: true, verb: before[0], operator: operator, interpolate: '${verb} ${operator}' }"
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"id": "add",
|
14
32
|
"isA": [
|
15
33
|
"verb"
|
16
34
|
],
|
17
|
-
"bridge": "{ ...next(operator),
|
18
|
-
"
|
19
|
-
"semantic": "async ({api, gsp, context}) => {\n const text = await gsp(context.reminder.slice(1));\n api.add({ text, when: context.when });\n }"
|
35
|
+
"bridge": "{ ...next(operator), arg: after[0], operator: operator, interpolate: '${operator} ${arg}' }",
|
36
|
+
"semantic": "({api, context}) => {\n api.addUser(api.contextToWho(context.arg))\n }"
|
20
37
|
},
|
21
38
|
{
|
22
|
-
"id": "
|
23
|
-
"
|
24
|
-
"
|
25
|
-
"
|
39
|
+
"id": "remove",
|
40
|
+
"words": [
|
41
|
+
"delete",
|
42
|
+
"remove"
|
43
|
+
],
|
44
|
+
"isA": [
|
45
|
+
"verb"
|
46
|
+
],
|
47
|
+
"bridge": "{ ...next(operator), arg: after[0], operator: operator, interpolate: '${operator} ${arg}' }",
|
48
|
+
"semantic": "({api, context}) => {\n api.removeUser(api.contextToWho(context.arg))\n }"
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"id": "addRemindable",
|
52
|
+
"isA": [
|
53
|
+
"verb"
|
54
|
+
],
|
55
|
+
"development": true,
|
56
|
+
"bridge": "{ ...next(operator), flatten: true, arg: after[0], operator: operator, interpolate: '${operator} ${arg}' }",
|
57
|
+
"semantic": "async ({api, context}) => {\n const name = context.arg.map( (word) => word.text ).join(' ')\n await api.addRemindable(name)\n }"
|
58
|
+
},
|
59
|
+
{
|
60
|
+
"id": "remindable",
|
61
|
+
"isA": [
|
62
|
+
"listable"
|
26
63
|
]
|
27
64
|
},
|
28
65
|
{
|
29
|
-
"id": "
|
66
|
+
"id": "remindResponse",
|
30
67
|
"isA": [
|
31
|
-
"
|
68
|
+
"verb"
|
32
69
|
],
|
33
|
-
"
|
70
|
+
"convolution": true,
|
71
|
+
"disabled": true,
|
72
|
+
"bridge": "{ ...next(operator), operator: operator, reminder: after[0], date: after[1], interpolate: '${reminder} ${date}' }",
|
73
|
+
"semantic": "async ({context, api, gp, gsp}) => {\n const text = await gsp(context.reminder.slice(0));\n const update = { text }\n if (context.date) {\n update.dateTimeSelector = context.date\n update.dateTimeSelectorText = await gp(context.date)\n }\n await api.update(update)\n }"
|
74
|
+
},
|
75
|
+
{
|
76
|
+
"id": "remind",
|
77
|
+
"isA": [
|
78
|
+
"verb"
|
79
|
+
],
|
80
|
+
"localHierarchy": [
|
81
|
+
[
|
82
|
+
"self",
|
83
|
+
"remindable"
|
84
|
+
]
|
85
|
+
],
|
86
|
+
"bridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], interpolate: '${operator} ${who} ${reminder}' }",
|
87
|
+
"justWhoBridge": "{ ...next(operator), bridge: 'justWhoBridge', operator: operator, who: after[0], interpolate: '${operator} ${who}' }",
|
88
|
+
"withDateBridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], date: after[2], interpolate: '${operator} ${who} ${reminder} ${date}' }",
|
89
|
+
"withDateFirstBridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[2], date: after[1], interpolate: '${operator} ${who} ${date} ${reminder}' }",
|
90
|
+
"withDateAndTimeBridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], date: after[2], time: after[3], interpolate: '${operator} ${who} ${reminder} ${date} ${time}' }",
|
91
|
+
"semantics": "[object Object]",
|
92
|
+
"semantic": "async ({ask, api, gsp, gp, context}) => {\n const who = api.contextToWho(context.who)\n let text;\n if (context.reminder) {\n text = await gsp(context.reminder.slice(1));\n }\n const reminder = { text, dateTimeSelector: context.date, who }\n if (context.date) {\n reminder.dateTimeSelector = context.date\n reminder.dateTimeSelectorText = await gp(context.date)\n }\n // await api.instantiate(reminder)\n await api.add(reminder)\n reminder.cleanUp = ask([\n query('missingReminder', reminder.id),\n query('missingDate', reminder.id),\n ])\n }"
|
34
93
|
},
|
35
94
|
{
|
36
95
|
"id": "reminders",
|
@@ -55,43 +114,97 @@
|
|
55
114
|
"semantic": "({context, api, verbatim}) => {\n const s = api.delete_reminder(context.reminders.value)\n if (s) {\n verbatim(s)\n }\n }"
|
56
115
|
}
|
57
116
|
]
|
58
|
-
},
|
59
|
-
{
|
60
|
-
"apply": "({ask, api}) => {\n ask([\n {\n where: where(),\n oneShot: false,\n onNevermind: ({verbatim, ...args}) => {\n // this is cross km boundaries from the dialogues km to this one so the api if for dialogs.\n // i need to get the one for fastfood here.\n const api = args.kms.fastfood.api\n const needsDrink = askAbout({ args, api })\n for (const item of needsDrink) {\n api.remove(item)\n }\n },\n\n matchq: ({ api, context }) => api.askAbout().length > 0 && context.marker == 'controlEnd',\n applyq: ({ api, context }) => {\n context.cascade = false\n const items = api.askAbout()\n const item = items[0]\n return 'When should I remind you to ' + item.text;\n },\n\n matchr: ({ isA, api, context }) => {\n if (isA(context.marker, 'reminderTime') && api.askAbout().length > 0) {\n return true\n }\n return false\n },\n applyr: ({ context, api }) => {\n const items = api.askAbout()\n api.update({ id: items[0].id, when: context })\n // TODO check for is available for all modifications\n /*\n const needsDrink = askAbout(args)\n const { api, context } = args\n if (isMany(context)) {\n let count = getCount(context) || Number.MAX_SAFE_INTEGER\n for (const item of needsDrink) {\n if (count < 1) {\n break\n }\n count -= 1\n api.addDrink(item.item_id, { id: context.value })\n }\n } else {\n const item_id = needsDrink[0].item_id\n api.addDrink(item_id, { id: context.value })\n }\n */\n }\n },\n ])\n }"
|
61
117
|
}
|
62
118
|
],
|
63
119
|
"resultss": [
|
64
120
|
{
|
65
121
|
"extraConfig": true,
|
66
122
|
"operators": [
|
67
|
-
"([
|
68
|
-
|
69
|
-
|
123
|
+
"([remindable])",
|
124
|
+
{
|
125
|
+
"pattern": "([addRemindable] (word)*)",
|
126
|
+
"development": true
|
127
|
+
},
|
128
|
+
"([remind:justWhoBridge] (remindable/*))",
|
129
|
+
"([remind] (remindable/*) (!@<= 'dateTimeSelector' && !@<= 'inAddition')*)",
|
130
|
+
"([remind:withDateBridge] (remindable/*) (!@<= 'dateTimeSelector' && !@<= 'inAddition')* (dateTimeSelector))",
|
131
|
+
"([remind:withDateFirstBridge] (remindable/*) (dateTimeSelector) (!@<= 'dateTimeSelector' && !@<= 'inAddition')*)",
|
132
|
+
"([remind:withDateAndTimeBridge] (remindable/*) (!@<= 'dateTimeSelector' && !@<= 'inAddition')* (dateTimeSelector) (atTime))",
|
133
|
+
"([remindResponse] (!@<= 'remindResponse' && !@<= 'dateTimeSelector' && !@<= 'inAddition')+ (dateTimeSelector))",
|
70
134
|
"([show] ([reminders]))",
|
71
|
-
"([delete_reminders|delete,cancel] (number/*))"
|
135
|
+
"([delete_reminders|delete,cancel] (number/*))",
|
136
|
+
"([add] (remindable/*))",
|
137
|
+
"([remove|] (remindable/*))",
|
138
|
+
"((verb/*) [inAddition|also,too])"
|
72
139
|
],
|
73
140
|
"bridges": [
|
74
141
|
{
|
75
|
-
"id": "
|
142
|
+
"id": "inAddition",
|
143
|
+
"after": [
|
144
|
+
"verb"
|
145
|
+
],
|
146
|
+
"bridge": "{ ...before[0], inAddition: true, verb: before[0], operator: operator, interpolate: '${verb} ${operator}' }"
|
147
|
+
},
|
148
|
+
{
|
149
|
+
"id": "add",
|
76
150
|
"isA": [
|
77
151
|
"verb"
|
78
152
|
],
|
79
|
-
"bridge": "{ ...next(operator),
|
80
|
-
|
153
|
+
"bridge": "{ ...next(operator), arg: after[0], operator: operator, interpolate: '${operator} ${arg}' }"
|
154
|
+
},
|
155
|
+
{
|
156
|
+
"id": "remove",
|
157
|
+
"words": [
|
158
|
+
"delete",
|
159
|
+
"remove"
|
160
|
+
],
|
161
|
+
"isA": [
|
162
|
+
"verb"
|
163
|
+
],
|
164
|
+
"bridge": "{ ...next(operator), arg: after[0], operator: operator, interpolate: '${operator} ${arg}' }"
|
165
|
+
},
|
166
|
+
{
|
167
|
+
"id": "addRemindable",
|
168
|
+
"isA": [
|
169
|
+
"verb"
|
170
|
+
],
|
171
|
+
"development": true,
|
172
|
+
"bridge": "{ ...next(operator), flatten: true, arg: after[0], operator: operator, interpolate: '${operator} ${arg}' }"
|
81
173
|
},
|
82
174
|
{
|
83
|
-
"id": "
|
84
|
-
"
|
85
|
-
"
|
86
|
-
"month_dates"
|
175
|
+
"id": "remindable",
|
176
|
+
"isA": [
|
177
|
+
"listable"
|
87
178
|
]
|
88
179
|
},
|
89
180
|
{
|
90
|
-
"id": "
|
181
|
+
"id": "remindResponse",
|
91
182
|
"isA": [
|
92
|
-
"
|
183
|
+
"verb"
|
93
184
|
],
|
94
|
-
"
|
185
|
+
"convolution": true,
|
186
|
+
"disabled": true,
|
187
|
+
"bridge": "{ ...next(operator), operator: operator, reminder: after[0], date: after[1], interpolate: '${reminder} ${date}' }"
|
188
|
+
},
|
189
|
+
{
|
190
|
+
"id": "remind",
|
191
|
+
"isA": [
|
192
|
+
"verb"
|
193
|
+
],
|
194
|
+
"localHierarchy": [
|
195
|
+
[
|
196
|
+
"self",
|
197
|
+
"remindable"
|
198
|
+
]
|
199
|
+
],
|
200
|
+
"bridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], interpolate: '${operator} ${who} ${reminder}' }",
|
201
|
+
"justWhoBridge": "{ ...next(operator), bridge: 'justWhoBridge', operator: operator, who: after[0], interpolate: '${operator} ${who}' }",
|
202
|
+
"withDateBridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], date: after[2], interpolate: '${operator} ${who} ${reminder} ${date}' }",
|
203
|
+
"withDateFirstBridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[2], date: after[1], interpolate: '${operator} ${who} ${date} ${reminder}' }",
|
204
|
+
"withDateAndTimeBridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], date: after[2], time: after[3], interpolate: '${operator} ${who} ${reminder} ${date} ${time}' }",
|
205
|
+
"semantics": [
|
206
|
+
{}
|
207
|
+
]
|
95
208
|
},
|
96
209
|
{
|
97
210
|
"id": "reminders",
|
@@ -114,9 +227,6 @@
|
|
114
227
|
"bridge": "{ ...next(operator), operator: operator, reminders: after[0], interpolate: '${operator} ${reminders}' }"
|
115
228
|
}
|
116
229
|
]
|
117
|
-
},
|
118
|
-
{
|
119
|
-
"apply": "({ask, api}) => {\n ask([\n {\n where: where(),\n oneShot: false,\n onNevermind: ({verbatim, ...args}) => {\n // this is cross km boundaries from the dialogues km to this one so the api if for dialogs.\n // i need to get the one for fastfood here.\n const api = args.kms.fastfood.api\n const needsDrink = askAbout({ args, api })\n for (const item of needsDrink) {\n api.remove(item)\n }\n },\n\n matchq: ({ api, context }) => api.askAbout().length > 0 && context.marker == 'controlEnd',\n applyq: ({ api, context }) => {\n context.cascade = false\n const items = api.askAbout()\n const item = items[0]\n return 'When should I remind you to ' + item.text;\n },\n\n matchr: ({ isA, api, context }) => {\n if (isA(context.marker, 'reminderTime') && api.askAbout().length > 0) {\n return true\n }\n return false\n },\n applyr: ({ context, api }) => {\n const items = api.askAbout()\n api.update({ id: items[0].id, when: context })\n // TODO check for is available for all modifications\n /*\n const needsDrink = askAbout(args)\n const { api, context } = args\n if (isMany(context)) {\n let count = getCount(context) || Number.MAX_SAFE_INTEGER\n for (const item of needsDrink) {\n if (count < 1) {\n break\n }\n count -= 1\n api.addDrink(item.item_id, { id: context.value })\n }\n } else {\n const item_id = needsDrink[0].item_id\n api.addDrink(item_id, { id: context.value })\n }\n */\n }\n },\n ])\n }"
|
120
230
|
}
|
121
231
|
],
|
122
232
|
"fragments": [],
|