tpmkms_4wp 9.3.0-beta.5 → 9.3.0-beta.6

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.
@@ -2,7 +2,10 @@
2
2
  "configs": [
3
3
  {
4
4
  "operators": [
5
- "([remind] (self/*) (*)*)"
5
+ "([remind] (self/*) (*)*)",
6
+ "([reminderTime|])",
7
+ "([show] ([reminders]))",
8
+ "([delete_reminders|delete,cancel] (number/*))"
6
9
  ],
7
10
  "bridges": [
8
11
  {
@@ -12,18 +15,49 @@
12
15
  ],
13
16
  "bridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], interpolate: '${operator} ${who} ${reminder}' }",
14
17
  "semantic": "async ({api, gsp, context}) => {\n const text = await gsp(context.reminder.slice(1));\n api.add({ text });\n }"
18
+ },
19
+ {
20
+ "id": "reminderTime",
21
+ "children": [
22
+ "month_dates"
23
+ ]
24
+ },
25
+ {
26
+ "id": "reminders",
27
+ "isA": [
28
+ "noun"
29
+ ]
30
+ },
31
+ {
32
+ "id": "show",
33
+ "isA": [
34
+ "verb"
35
+ ],
36
+ "bridge": "{ ...next(operator), operator: operator, reminders: after[0], interpolate: '${operator} ${reminders}' }",
37
+ "semantic": "({context, api, verbatim}) => {\n verbatim(api.show())\n }"
38
+ },
39
+ {
40
+ "id": "delete_reminders",
41
+ "isA": [
42
+ "verb"
43
+ ],
44
+ "bridge": "{ ...next(operator), operator: operator, reminders: after[0], interpolate: '${operator} ${reminders}' }",
45
+ "semantic": "({context, api, verbatim}) => {\n const s = api.delete_reminder(context.reminders.value)\n if (s) {\n verbatim(s)\n }\n }"
15
46
  }
16
47
  ]
17
48
  },
18
49
  {
19
- "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: (args) => args.api.askAbout(args).length > 0 && args.context.marker == 'controlEnd',\n applyq: (args) => {\n args.context.cascade = false\n const items = askAbout(args)\n const item = items[0]\n debugger;\n debugger\n },\n\n matchr: (args) => {\n if (args.isA(args.context.marker, 'drink') && askAbout(args).length > 0) {\n const needsDrink = askAbout(args)\n if (args.api.isAvailableModification(needsDrink[0].food, { ...args.context , id: args.context.value })) {\n return true\n }\n }\n return false\n },\n applyr: (args) => {\n // TODO check for is available for all modifications\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 }"
50
+ "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 }"
20
51
  }
21
52
  ],
22
53
  "resultss": [
23
54
  {
24
55
  "extraConfig": true,
25
56
  "operators": [
26
- "([remind] (self/*) (*)*)"
57
+ "([remind] (self/*) (*)*)",
58
+ "([reminderTime|])",
59
+ "([show] ([reminders]))",
60
+ "([delete_reminders|delete,cancel] (number/*))"
27
61
  ],
28
62
  "bridges": [
29
63
  {
@@ -32,11 +66,37 @@
32
66
  "verb"
33
67
  ],
34
68
  "bridge": "{ ...next(operator), operator: operator, who: after[0], reminder: after[1], interpolate: '${operator} ${who} ${reminder}' }"
69
+ },
70
+ {
71
+ "id": "reminderTime",
72
+ "children": [
73
+ "month_dates"
74
+ ]
75
+ },
76
+ {
77
+ "id": "reminders",
78
+ "isA": [
79
+ "noun"
80
+ ]
81
+ },
82
+ {
83
+ "id": "show",
84
+ "isA": [
85
+ "verb"
86
+ ],
87
+ "bridge": "{ ...next(operator), operator: operator, reminders: after[0], interpolate: '${operator} ${reminders}' }"
88
+ },
89
+ {
90
+ "id": "delete_reminders",
91
+ "isA": [
92
+ "verb"
93
+ ],
94
+ "bridge": "{ ...next(operator), operator: operator, reminders: after[0], interpolate: '${operator} ${reminders}' }"
35
95
  }
36
96
  ]
37
97
  },
38
98
  {
39
- "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: (args) => args.api.askAbout(args).length > 0 && args.context.marker == 'controlEnd',\n applyq: (args) => {\n args.context.cascade = false\n const items = askAbout(args)\n const item = items[0]\n debugger;\n debugger\n },\n\n matchr: (args) => {\n if (args.isA(args.context.marker, 'drink') && askAbout(args).length > 0) {\n const needsDrink = askAbout(args)\n if (args.api.isAvailableModification(needsDrink[0].food, { ...args.context , id: args.context.value })) {\n return true\n }\n }\n return false\n },\n applyr: (args) => {\n // TODO check for is available for all modifications\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 }"
99
+ "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 }"
40
100
  }
41
101
  ],
42
102
  "fragments": [],
@@ -85,6 +85,7 @@ const template = {
85
85
  {
86
86
  id: 'reminderTime',
87
87
  children: [
88
+ 'day_dates',
88
89
  'month_dates',
89
90
  ],
90
91
  },
@@ -137,6 +138,7 @@ const template = {
137
138
  },
138
139
 
139
140
  matchr: ({ isA, api, context }) => {
141
+ debugger
140
142
  if (isA(context.marker, 'reminderTime') && api.askAbout().length > 0) {
141
143
  return true
142
144
  }
@@ -144,6 +146,7 @@ const template = {
144
146
  },
145
147
  applyr: ({ context, api }) => {
146
148
  const items = api.askAbout()
149
+ debugger
147
150
  api.update({ id: items[0].id, when: context })
148
151
  // TODO check for is available for all modifications
149
152
  /*