tpmkms_4wp 9.3.0-beta.22 → 9.3.0-beta.24
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/helpers/dialogues.js +2 -2
- package/common/reminders.js +6 -8
- package/common/reminders.test.json +6409 -0
- package/package.json +2 -2
@@ -77,7 +77,7 @@ class API {
|
|
77
77
|
}
|
78
78
|
|
79
79
|
// word is for one or many
|
80
|
-
makeObject({config, context, types=[], source_value=undefined, doPluralize=true} = {}) {
|
80
|
+
makeObject({config, context, types=[], source_value=undefined, doPluralize=true, initial=''} = {}) {
|
81
81
|
if (typeof context == 'string') {
|
82
82
|
context = { word: context, value: context }
|
83
83
|
}
|
@@ -102,7 +102,7 @@ class API {
|
|
102
102
|
config.addOperator({ pattern: `(["${concept}"])`, allowDups: true })
|
103
103
|
config.addBridge({ id: concept, level: 0, bridge: `{ ...next(operator), value: or(operator.value, '${source_value || concept}') }` , allowDups: true })
|
104
104
|
const addConcept = (word, number) => {
|
105
|
-
config.addWord(word, { id: concept, initial: `{ value: "${source_value || concept}", number: "${number}" }` } )
|
105
|
+
config.addWord(word, { id: concept, initial: `{ value: "${source_value || concept}", number: "${number}" ${initial ? ', ': ''}${initial} }` } )
|
106
106
|
const baseTypes = [
|
107
107
|
'theAble',
|
108
108
|
'queryable',
|
package/common/reminders.js
CHANGED
@@ -16,9 +16,6 @@ const helpers = require('./helpers')
|
|
16
16
|
remind greg to go to regina
|
17
17
|
remind every truck driver to whatever tomorrow at 8 am
|
18
18
|
remind greg and bob to go to bolivia and see the xyz corporation
|
19
|
-
|
20
|
-
remind me to go\nmonday at 10 am
|
21
|
-
remind me to go\non monday at 10 am
|
22
19
|
*/
|
23
20
|
|
24
21
|
class API {
|
@@ -40,7 +37,8 @@ class API {
|
|
40
37
|
if (!text) {
|
41
38
|
text = id
|
42
39
|
}
|
43
|
-
|
40
|
+
debugger
|
41
|
+
this.args.makeObject({ ...this.args, context: { word: text, value: id, number: 'one', remindee_id: id }, initial: `remindee_id: "${id}"`, types: ['remindable'] })
|
44
42
|
}
|
45
43
|
|
46
44
|
async instantiate(reminder) {
|
@@ -115,7 +113,7 @@ const template = {
|
|
115
113
|
id: 'addRemindable',
|
116
114
|
isA: ['verb'],
|
117
115
|
development: true,
|
118
|
-
bridge: "{ ...next(operator), arg: after[0], operator: operator, interpolate: '${operator} ${arg}' }",
|
116
|
+
bridge: "{ ...next(operator), flatten: true, arg: after[0], operator: operator, interpolate: '${operator} ${arg}' }",
|
119
117
|
semantic: ({api, context}) => {
|
120
118
|
const name = context.arg.map( (word) => word.text ).join(' ')
|
121
119
|
api.addRemindable(name)
|
@@ -133,7 +131,7 @@ const template = {
|
|
133
131
|
withDateAndTimeBridge: "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], date: after[2], time: after[3], interpolate: '${operator} ${who} ${reminder} ${date} ${time}' }",
|
134
132
|
semantic: async ({api, gsp, gp, context}) => {
|
135
133
|
const text = await gsp(context.reminder.slice(1));
|
136
|
-
const who = { id: context.who.value || context.who.text, text: context.who.text }
|
134
|
+
const who = { id: context.who.value || context.who.text, text: context.who.text, remindee_id: context.who.remindee_id }
|
137
135
|
const reminder = { text, dateTimeSelector: context.date, who }
|
138
136
|
if (context.date) {
|
139
137
|
reminder.dateTimeSelector = context.date
|
@@ -225,13 +223,13 @@ knowledgeModule( {
|
|
225
223
|
filter: [
|
226
224
|
'text',
|
227
225
|
'dateTimeSelectorText',
|
228
|
-
'who',
|
229
226
|
'nextISODate',
|
227
|
+
'who',
|
230
228
|
'stm',
|
231
229
|
{
|
232
230
|
property: 'dateTimeSelector',
|
233
231
|
filter: ['marker', 'text', 'value'],
|
234
|
-
}
|
232
|
+
},
|
235
233
|
],
|
236
234
|
}
|
237
235
|
],
|