tpmkms_4wp 9.3.0-beta.21 → 9.3.0-beta.23

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.
@@ -89995,6 +89995,42 @@
89995
89995
  0
89996
89996
  ]
89997
89997
  ],
89998
+ [
89999
+ [
90000
+ "list",
90001
+ 1
90002
+ ],
90003
+ [
90004
+ "modifies",
90005
+ 0
90006
+ ],
90007
+ [
90008
+ "strawberry",
90009
+ 0
90010
+ ],
90011
+ [
90012
+ "unknown",
90013
+ 0
90014
+ ]
90015
+ ],
90016
+ [
90017
+ [
90018
+ "list",
90019
+ 1
90020
+ ],
90021
+ [
90022
+ "modifies",
90023
+ 0
90024
+ ],
90025
+ [
90026
+ "strawberry",
90027
+ 0
90028
+ ],
90029
+ [
90030
+ "unknown",
90031
+ 0
90032
+ ]
90033
+ ],
89998
90034
  [
89999
90035
  [
90000
90036
  "list",
@@ -110414,6 +110450,24 @@
110414
110450
  0
110415
110451
  ]
110416
110452
  ],
110453
+ [
110454
+ [
110455
+ "ingredient",
110456
+ 0
110457
+ ],
110458
+ [
110459
+ "is",
110460
+ 0
110461
+ ],
110462
+ [
110463
+ "list",
110464
+ 1
110465
+ ],
110466
+ [
110467
+ "smoothie",
110468
+ 0
110469
+ ]
110470
+ ],
110417
110471
  [
110418
110472
  [
110419
110473
  "ingredient",
@@ -347771,6 +347825,24 @@
347771
347825
  0
347772
347826
  ]
347773
347827
  ],
347828
+ [
347829
+ [
347830
+ "breakfast",
347831
+ 0
347832
+ ],
347833
+ [
347834
+ "is",
347835
+ 0
347836
+ ],
347837
+ [
347838
+ "list",
347839
+ 1
347840
+ ],
347841
+ [
347842
+ "meal",
347843
+ 0
347844
+ ]
347845
+ ],
347774
347846
  [
347775
347847
  [
347776
347848
  "is",
@@ -362097,6 +362169,20 @@
362097
362169
  1
362098
362170
  ]
362099
362171
  ],
362172
+ [
362173
+ [
362174
+ "is",
362175
+ 0
362176
+ ],
362177
+ [
362178
+ "list",
362179
+ 1
362180
+ ],
362181
+ [
362182
+ "meal",
362183
+ 0
362184
+ ]
362185
+ ],
362100
362186
  [
362101
362187
  [
362102
362188
  "is",
@@ -573379,6 +573465,24 @@
573379
573465
  0
573380
573466
  ]
573381
573467
  ],
573468
+ [
573469
+ [
573470
+ "is",
573471
+ 0
573472
+ ],
573473
+ [
573474
+ "kid",
573475
+ 0
573476
+ ],
573477
+ [
573478
+ "list",
573479
+ 1
573480
+ ],
573481
+ [
573482
+ "meal",
573483
+ 0
573484
+ ]
573485
+ ],
573382
573486
  [
573383
573487
  [
573384
573488
  "is",
@@ -595815,6 +595919,60 @@
595815
595919
  0
595816
595920
  ]
595817
595921
  ],
595922
+ [
595923
+ [
595924
+ "bacon",
595925
+ 0
595926
+ ],
595927
+ [
595928
+ "cheeseburger",
595929
+ 0
595930
+ ],
595931
+ [
595932
+ "chicken",
595933
+ 0
595934
+ ],
595935
+ [
595936
+ "club",
595937
+ 0
595938
+ ],
595939
+ [
595940
+ "comma",
595941
+ 0
595942
+ ],
595943
+ [
595944
+ "crispy",
595945
+ 0
595946
+ ],
595947
+ [
595948
+ "go",
595949
+ 0
595950
+ ],
595951
+ [
595952
+ "is",
595953
+ 0
595954
+ ],
595955
+ [
595956
+ "junior",
595957
+ 0
595958
+ ],
595959
+ [
595960
+ "list",
595961
+ 0
595962
+ ],
595963
+ [
595964
+ "meal",
595965
+ 0
595966
+ ],
595967
+ [
595968
+ "value",
595969
+ 0
595970
+ ],
595971
+ [
595972
+ "wrap",
595973
+ 0
595974
+ ]
595975
+ ],
595818
595976
  [
595819
595977
  [
595820
595978
  "chicken",
@@ -595937,6 +596095,40 @@
595937
596095
  0
595938
596096
  ]
595939
596097
  ],
596098
+ [
596099
+ [
596100
+ "chicken",
596101
+ 0
596102
+ ],
596103
+ [
596104
+ "club",
596105
+ 0
596106
+ ],
596107
+ [
596108
+ "crispy",
596109
+ 0
596110
+ ],
596111
+ [
596112
+ "is",
596113
+ 0
596114
+ ],
596115
+ [
596116
+ "junior",
596117
+ 0
596118
+ ],
596119
+ [
596120
+ "list",
596121
+ 0
596122
+ ],
596123
+ [
596124
+ "meal",
596125
+ 0
596126
+ ],
596127
+ [
596128
+ "value",
596129
+ 0
596130
+ ]
596131
+ ],
595940
596132
  [
595941
596133
  [
595942
596134
  "chicken",
@@ -610048,6 +610240,60 @@
610048
610240
  0
610049
610241
  ]
610050
610242
  ],
610243
+ [
610244
+ [
610245
+ "bacon",
610246
+ 0
610247
+ ],
610248
+ [
610249
+ "cheeseburger",
610250
+ 0
610251
+ ],
610252
+ [
610253
+ "chicken",
610254
+ 0
610255
+ ],
610256
+ [
610257
+ "club",
610258
+ 0
610259
+ ],
610260
+ [
610261
+ "comma",
610262
+ 0
610263
+ ],
610264
+ [
610265
+ "crispy",
610266
+ 0
610267
+ ],
610268
+ [
610269
+ "go",
610270
+ 0
610271
+ ],
610272
+ [
610273
+ "is",
610274
+ 0
610275
+ ],
610276
+ [
610277
+ "junior",
610278
+ 0
610279
+ ],
610280
+ [
610281
+ "list",
610282
+ 0
610283
+ ],
610284
+ [
610285
+ "meal",
610286
+ 0
610287
+ ],
610288
+ [
610289
+ "value",
610290
+ 0
610291
+ ],
610292
+ [
610293
+ "wrap",
610294
+ 0
610295
+ ]
610296
+ ],
610051
610297
  [
610052
610298
  [
610053
610299
  "bacon",
@@ -611444,6 +611690,24 @@
611444
611690
  0
611445
611691
  ]
611446
611692
  ],
611693
+ [
611694
+ [
611695
+ "breakfast",
611696
+ 0
611697
+ ],
611698
+ [
611699
+ "is",
611700
+ 0
611701
+ ],
611702
+ [
611703
+ "list",
611704
+ 1
611705
+ ],
611706
+ [
611707
+ "meal",
611708
+ 0
611709
+ ]
611710
+ ],
611447
611711
  [
611448
611712
  [
611449
611713
  "breakfast",
@@ -611930,6 +612194,40 @@
611930
612194
  0
611931
612195
  ]
611932
612196
  ],
612197
+ [
612198
+ [
612199
+ "chicken",
612200
+ 0
612201
+ ],
612202
+ [
612203
+ "club",
612204
+ 0
612205
+ ],
612206
+ [
612207
+ "crispy",
612208
+ 0
612209
+ ],
612210
+ [
612211
+ "is",
612212
+ 0
612213
+ ],
612214
+ [
612215
+ "junior",
612216
+ 0
612217
+ ],
612218
+ [
612219
+ "list",
612220
+ 0
612221
+ ],
612222
+ [
612223
+ "meal",
612224
+ 0
612225
+ ],
612226
+ [
612227
+ "value",
612228
+ 0
612229
+ ]
612230
+ ],
611933
612231
  [
611934
612232
  [
611935
612233
  "chicken",
@@ -613372,6 +613670,24 @@
613372
613670
  0
613373
613671
  ]
613374
613672
  ],
613673
+ [
613674
+ [
613675
+ "ingredient",
613676
+ 0
613677
+ ],
613678
+ [
613679
+ "is",
613680
+ 0
613681
+ ],
613682
+ [
613683
+ "list",
613684
+ 1
613685
+ ],
613686
+ [
613687
+ "smoothie",
613688
+ 0
613689
+ ]
613690
+ ],
613375
613691
  [
613376
613692
  [
613377
613693
  "ingredient",
@@ -613434,6 +613750,24 @@
613434
613750
  0
613435
613751
  ]
613436
613752
  ],
613753
+ [
613754
+ [
613755
+ "is",
613756
+ 0
613757
+ ],
613758
+ [
613759
+ "kid",
613760
+ 0
613761
+ ],
613762
+ [
613763
+ "list",
613764
+ 1
613765
+ ],
613766
+ [
613767
+ "meal",
613768
+ 0
613769
+ ]
613770
+ ],
613437
613771
  [
613438
613772
  [
613439
613773
  "is",
@@ -613616,6 +613950,20 @@
613616
613950
  0
613617
613951
  ]
613618
613952
  ],
613953
+ [
613954
+ [
613955
+ "is",
613956
+ 0
613957
+ ],
613958
+ [
613959
+ "list",
613960
+ 1
613961
+ ],
613962
+ [
613963
+ "meal",
613964
+ 0
613965
+ ]
613966
+ ],
613619
613967
  [
613620
613968
  [
613621
613969
  "is",
@@ -613984,6 +614332,42 @@
613984
614332
  0
613985
614333
  ]
613986
614334
  ],
614335
+ [
614336
+ [
614337
+ "list",
614338
+ 1
614339
+ ],
614340
+ [
614341
+ "modifies",
614342
+ 0
614343
+ ],
614344
+ [
614345
+ "strawberry",
614346
+ 0
614347
+ ],
614348
+ [
614349
+ "unknown",
614350
+ 0
614351
+ ]
614352
+ ],
614353
+ [
614354
+ [
614355
+ "list",
614356
+ 1
614357
+ ],
614358
+ [
614359
+ "modifies",
614360
+ 0
614361
+ ],
614362
+ [
614363
+ "strawberry",
614364
+ 0
614365
+ ],
614366
+ [
614367
+ "unknown",
614368
+ 0
614369
+ ]
614370
+ ],
613987
614371
  [
613988
614372
  [
613989
614373
  "list",
@@ -48,12 +48,7 @@ function getTime(time) {
48
48
  }
49
49
 
50
50
  instantiate = (now, context) => {
51
- if (context.dateTimeSelector) {
52
- const dateTimeSelector = getNextDayOfWeek(now, context.dateTimeSelector?.value)
53
- if (dateTimeSelector) {
54
- return dateTimeSelector.toISOString()
55
- }
56
- } else if (context.marker == 'dateTimeSelector') {
51
+ if (context.marker == 'dateTimeSelector') {
57
52
  // (on date) OR (date)
58
53
  const date = context.date?.date || context.date
59
54
  const dateTimeSelector = getNextDayOfWeek(now, date.value)
@@ -63,6 +58,16 @@ instantiate = (now, context) => {
63
58
  dateTimeSelector.setSeconds(hms.second)
64
59
  dateTimeSelector.setMilliseconds(0)
65
60
  return dateTimeSelector.toISOString()
61
+ } else if (context.dateTimeSelector) {
62
+ const dateTimeSelector = getNextDayOfWeek(now, context.dateTimeSelector?.value)
63
+ if (dateTimeSelector) {
64
+ return dateTimeSelector.toISOString()
65
+ }
66
+ } else if (context.value) {
67
+ const dateTimeSelector = getNextDayOfWeek(now, context.value)
68
+ if (dateTimeSelector) {
69
+ return dateTimeSelector.toISOString()
70
+ }
66
71
  }
67
72
  }
68
73
 
@@ -1713,6 +1713,20 @@
1713
1713
  0
1714
1714
  ]
1715
1715
  ],
1716
+ [
1717
+ [
1718
+ "is",
1719
+ 0
1720
+ ],
1721
+ [
1722
+ "list",
1723
+ 1
1724
+ ],
1725
+ [
1726
+ "unknown",
1727
+ 0
1728
+ ]
1729
+ ],
1716
1730
  [
1717
1731
  [
1718
1732
  "is",
@@ -10182,6 +10196,20 @@
10182
10196
  0
10183
10197
  ]
10184
10198
  ],
10199
+ [
10200
+ [
10201
+ "is",
10202
+ 0
10203
+ ],
10204
+ [
10205
+ "list",
10206
+ 1
10207
+ ],
10208
+ [
10209
+ "unknown",
10210
+ 0
10211
+ ]
10212
+ ],
10185
10213
  [
10186
10214
  [
10187
10215
  "is",
@@ -35613,6 +35641,34 @@
35613
35641
  0
35614
35642
  ]
35615
35643
  ],
35644
+ [
35645
+ [
35646
+ "is",
35647
+ 0
35648
+ ],
35649
+ [
35650
+ "list",
35651
+ 1
35652
+ ],
35653
+ [
35654
+ "unknown",
35655
+ 0
35656
+ ]
35657
+ ],
35658
+ [
35659
+ [
35660
+ "is",
35661
+ 0
35662
+ ],
35663
+ [
35664
+ "list",
35665
+ 1
35666
+ ],
35667
+ [
35668
+ "unknown",
35669
+ 0
35670
+ ]
35671
+ ],
35616
35672
  [
35617
35673
  [
35618
35674
  "is",
@@ -40,7 +40,7 @@
40
40
  "bridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], interpolate: '${operator} ${who} ${reminder}' }",
41
41
  "withDateBridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], date: after[2], interpolate: '${operator} ${who} ${reminder} ${date}' }",
42
42
  "withDateAndTimeBridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], date: after[2], time: after[3], interpolate: '${operator} ${who} ${reminder} ${date} ${time}' }",
43
- "semantic": "async ({api, gsp, gp, context}) => {\n const text = await gsp(context.reminder.slice(1));\n const reminder = { text, dateTimeSelector: context.date }\n if (context.date) {\n reminder.dateTimeSelector = context.date\n reminder.dateTimeSelectorText = await gp(context.date)\n }\n await api.instantiate(reminder)\n api.add(reminder)\n }"
43
+ "semantic": "async ({api, gsp, gp, context}) => {\n const text = await gsp(context.reminder.slice(1));\n const who = { id: context.who.value || context.who.text, text: context.who.text }\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 }"
44
44
  },
45
45
  {
46
46
  "id": "reminders",
@@ -67,7 +67,7 @@
67
67
  ]
68
68
  },
69
69
  {
70
- "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, 'onDateValue_dates') && api.askAbout().length > 0) {\n return true\n }\n return false\n },\n applyr: async ({ context, api, gp }) => {\n const items = api.askAbout()\n api.update({ id: items[0].id, dateTimeSelector: context, dateTimeSelectorText: await gp(context) })\n }\n },\n ])\n }"
70
+ "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, 'onDateValue_dates') || isA(context.marker, 'dateTimeSelector')) && api.askAbout().length > 0) {\n return true\n }\n return false\n },\n applyr: async ({ context, api, gp }) => {\n const items = api.askAbout()\n await api.update({ id: items[0].id, dateTimeSelector: context, dateTimeSelectorText: await gp(context) })\n }\n },\n ])\n }"
71
71
  }
72
72
  ],
73
73
  "resultss": [
@@ -135,7 +135,7 @@
135
135
  ]
136
136
  },
137
137
  {
138
- "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, 'onDateValue_dates') && api.askAbout().length > 0) {\n return true\n }\n return false\n },\n applyr: async ({ context, api, gp }) => {\n const items = api.askAbout()\n api.update({ id: items[0].id, dateTimeSelector: context, dateTimeSelectorText: await gp(context) })\n }\n },\n ])\n }"
138
+ "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, 'onDateValue_dates') || isA(context.marker, 'dateTimeSelector')) && api.askAbout().length > 0) {\n return true\n }\n return false\n },\n applyr: async ({ context, api, gp }) => {\n const items = api.askAbout()\n await api.update({ id: items[0].id, dateTimeSelector: context, dateTimeSelectorText: await gp(context) })\n }\n },\n ])\n }"
139
139
  }
140
140
  ],
141
141
  "fragments": [],
@@ -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 {
@@ -28,7 +25,8 @@ class API {
28
25
  this._objects.id = 0
29
26
  }
30
27
 
31
- add(reminder) {
28
+ async add(reminder) {
29
+ await this.instantiate(reminder)
32
30
  const id = ++this._objects.id
33
31
  reminder.id = id
34
32
  this._objects.reminders.push(reminder)
@@ -82,10 +80,11 @@ class API {
82
80
  this._objects.reminders = this._objects.reminders.splice(ordinal, 1)
83
81
  }
84
82
 
85
- update(update) {
83
+ async update(update) {
86
84
  for (const item of this._objects.reminders) {
87
85
  if (item.id == update.id) {
88
86
  Object.assign(item, update)
87
+ await this.instantiate(item)
89
88
  return
90
89
  }
91
90
  }
@@ -113,7 +112,7 @@ const template = {
113
112
  id: 'addRemindable',
114
113
  isA: ['verb'],
115
114
  development: true,
116
- bridge: "{ ...next(operator), arg: after[0], operator: operator, interpolate: '${operator} ${arg}' }",
115
+ bridge: "{ ...next(operator), flatten: true, arg: after[0], operator: operator, interpolate: '${operator} ${arg}' }",
117
116
  semantic: ({api, context}) => {
118
117
  const name = context.arg.map( (word) => word.text ).join(' ')
119
118
  api.addRemindable(name)
@@ -137,8 +136,8 @@ const template = {
137
136
  reminder.dateTimeSelector = context.date
138
137
  reminder.dateTimeSelectorText = await gp(context.date)
139
138
  }
140
- await api.instantiate(reminder)
141
- api.add(reminder)
139
+ // await api.instantiate(reminder)
140
+ await api.add(reminder)
142
141
  },
143
142
  },
144
143
  {
@@ -197,7 +196,7 @@ const template = {
197
196
  },
198
197
  applyr: async ({ context, api, gp }) => {
199
198
  const items = api.askAbout()
200
- api.update({ id: items[0].id, dateTimeSelector: context, dateTimeSelectorText: await gp(context) })
199
+ await api.update({ id: items[0].id, dateTimeSelector: context, dateTimeSelectorText: await gp(context) })
201
200
  }
202
201
  },
203
202
  ])
@@ -223,13 +222,13 @@ knowledgeModule( {
223
222
  filter: [
224
223
  'text',
225
224
  'dateTimeSelectorText',
226
- 'who',
227
225
  'nextISODate',
226
+ 'who',
228
227
  'stm',
229
228
  {
230
229
  property: 'dateTimeSelector',
231
230
  filter: ['marker', 'text', 'value'],
232
- }
231
+ },
233
232
  ],
234
233
  }
235
234
  ],