tpmkms 9.8.0-beta.1 → 9.8.0-beta.10

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.
Files changed (55) hide show
  1. package/common/actions.instance.json +1 -1
  2. package/common/actions.js +3 -1
  3. package/common/askfor.instance.json +7 -1
  4. package/common/askfor.js +5 -2
  5. package/common/asking.js +9 -4
  6. package/common/avatar.js +1 -1
  7. package/common/concept.instance.json +8 -4
  8. package/common/concept.js +2 -0
  9. package/common/conjunction.js +2 -0
  10. package/common/control.js +2 -2
  11. package/common/countable.js +1 -0
  12. package/common/dateTimeSelectors.instance.json +3 -3
  13. package/common/dateTimeSelectors.js +3 -6
  14. package/common/dates.instance.json +10 -0
  15. package/common/dates.js +5 -0
  16. package/common/debug.instance.json +5 -1
  17. package/common/debug.js +2 -0
  18. package/common/dialogues.js +10 -6
  19. package/common/dimension.instance.json +16 -14
  20. package/common/dimension.js +6 -5
  21. package/common/drone.instance.json +41 -17
  22. package/common/drone.js +24 -12
  23. package/common/drone_v1.instance.json +10 -0
  24. package/common/drone_v1.js +5 -0
  25. package/common/evaluate.js +6 -12
  26. package/common/fastfood.instance.json +10 -2
  27. package/common/fastfood.js +6 -0
  28. package/common/formulas.instance.json +2 -2
  29. package/common/formulas.js +3 -3
  30. package/common/gdefaults.js +3 -3
  31. package/common/hierarchy.js +2 -2
  32. package/common/menus.instance.json +5 -1
  33. package/common/menus.js +3 -0
  34. package/common/meta.js +2 -1
  35. package/common/nameable.js +4 -2
  36. package/common/ordinals.js +1 -1
  37. package/common/percentages.js +2 -0
  38. package/common/pipboy.instance.json +34 -22
  39. package/common/pipboy.js +18 -11
  40. package/common/properties.instance.json +26 -26
  41. package/common/properties.js +17 -23
  42. package/common/punctuation.js +1 -0
  43. package/common/rates.instance.json +1 -1
  44. package/common/rates.js +1 -1
  45. package/common/reminders.instance.json +16 -0
  46. package/common/reminders.js +10 -7
  47. package/common/reports.instance.json +1 -1
  48. package/common/scorekeeper.js +6 -6
  49. package/common/sdefaults.js +3 -2
  50. package/common/stm.js +9 -8
  51. package/common/time.instance.json +3 -3
  52. package/common/time.js +3 -3
  53. package/common/wp.instance.json +10 -4
  54. package/common/wp.js +5 -2
  55. package/package.json +2 -2
@@ -166,7 +166,7 @@
166
166
  },
167
167
  "semantics": [
168
168
  {
169
- "match": "({context, isA, stack, namespaced}) => !context.pullFromContext && !context.evaluate && (isA(context.marker, 'action') || isA(context.marker, 'doAction')) && !namespaced.get('actions', context, 'logged')",
169
+ "match": "({context, isA, contextHierarchy, stack, namespaced}) => {\n return !context.pullFromContext && !contextHierarchy.under('call') && (isA(context.marker, 'action') || isA(context.marker, 'doAction')) && !namespaced.get('actions', context, 'logged')\n }",
170
170
  "apply": "async ({context, _continue, testLog, g, remember}) => {\n remember(context)\n await testLog(() => g(context))\n _continue()\n }"
171
171
  }
172
172
  ]
package/common/actions.js CHANGED
@@ -147,7 +147,9 @@ const config = {
147
147
  {
148
148
  where: where(),
149
149
  priority: -1,
150
- match: ({context, isA, stack, namespaced}) => !context.pullFromContext && !context.evaluate && (isA(context.marker, 'action') || isA(context.marker, 'doAction')) && !namespaced.get('actions', context, 'logged'),
150
+ match: ({context, isA, contextHierarchy, stack, namespaced}) => {
151
+ return !context.pullFromContext && !contextHierarchy.under('call') && (isA(context.marker, 'action') || isA(context.marker, 'doAction')) && !namespaced.get('actions', context, 'logged')
152
+ },
151
153
  apply: async ({context, _continue, testLog, g, remember}) => {
152
154
  remember(context)
153
155
  await testLog(() => g(context))
@@ -30,6 +30,7 @@
30
30
  },
31
31
  {
32
32
  "id": "known",
33
+ "where": "/home/dev/code/theprogrammablemind/kms/common/askfor.js:77",
33
34
  "isA": [
34
35
  "queryable"
35
36
  ],
@@ -37,6 +38,7 @@
37
38
  },
38
39
  {
39
40
  "id": "information",
41
+ "where": "/home/dev/code/theprogrammablemind/kms/common/askfor.js:86",
40
42
  "isA": [
41
43
  "noun"
42
44
  ],
@@ -57,6 +59,7 @@
57
59
  },
58
60
  {
59
61
  "id": "askfor_askfor",
62
+ "where": "/home/dev/code/theprogrammablemind/kms/common/askfor.js:112",
60
63
  "isA": [
61
64
  "verb"
62
65
  ],
@@ -64,7 +67,7 @@
64
67
  "ask"
65
68
  ],
66
69
  "bridge": "{\n ...next(operator),\n properties: after[0],\n interpolate: [{ self: true }, { property: 'properties' }]\n }",
67
- "semantic": "async ({e, s, gp, objects, flatten, context, ask, fragments, toEValue}) => {\n const argument = context.properties.argument\n const getValue = (property) => async (args) => {\n const value = toEValue(await e(property))\n if (value.marker == 'answerNotKnown') {\n return\n }\n return value\n }\n\n const setValue = (property) => async ({ context, namespaced, tag }) => {\n const is = { marker: 'is', one: property, two: context }\n namespaced.set('dialogs', is, 'allowHierarchy', false)\n await s(is)\n }\n\n const properties = flattenInPlace(argument)\n counter = 0\n for (const property of properties.reverse()) {\n counter += 1\n const query = memoizeAsync(async () => await(gp(await fragments(\"what is the concept?\", { concept: property }))))\n const compatible_types = property.compatible_types || [property.marker]\n const matchr = ({context, isA}) => {\n return !context.same && !context.evaluate && isA(context, compatible_types)\n }\n objects.askFor.push(property);\n askForProperty({\n ask,\n tag: `ask#${counter}`,\n getValue: getValue(property),\n setValue: setValue(property),\n query,\n matchr,\n })\n }\n }"
70
+ "semantic": "async ({e, s, gp, objects, flatten, context, ask, fragments, toEValue}) => {\n const argument = context.properties.argument\n const getValue = (property) => async (args) => {\n const value = toEValue(await e(property))\n if (value.marker === 'undefined') {\n return\n }\n return value\n }\n\n const setValue = (property) => async ({ context, namespaced, tag }) => {\n const is = { marker: 'is', one: property, two: context }\n namespaced.set('dialogs', is, 'allowHierarchy', false)\n await s(is)\n }\n\n const properties = flattenInPlace(argument)\n counter = 0\n for (const property of properties.reverse()) {\n counter += 1\n const query = memoizeAsync(async () => await(gp(await fragments(\"what is the concept?\", { concept: property }))))\n const compatible_types = property.compatible_types || [property.marker]\n const matchr = ({context, isA}) => {\n return !context.same && isA(context, compatible_types)\n }\n objects.askFor.push(property);\n askForProperty({\n ask,\n tag: `ask#${counter}`,\n getValue: getValue(property),\n setValue: setValue(property),\n query,\n matchr,\n })\n }\n }"
68
71
  }
69
72
  ]
70
73
  },
@@ -893,12 +896,14 @@
893
896
  },
894
897
  {
895
898
  "id": "known",
899
+ "where": "/home/dev/code/theprogrammablemind/kms/common/askfor.js:77",
896
900
  "isA": [
897
901
  "queryable"
898
902
  ]
899
903
  },
900
904
  {
901
905
  "id": "information",
906
+ "where": "/home/dev/code/theprogrammablemind/kms/common/askfor.js:86",
902
907
  "isA": [
903
908
  "noun"
904
909
  ]
@@ -918,6 +923,7 @@
918
923
  },
919
924
  {
920
925
  "id": "askfor_askfor",
926
+ "where": "/home/dev/code/theprogrammablemind/kms/common/askfor.js:112",
921
927
  "isA": [
922
928
  "verb"
923
929
  ],
package/common/askfor.js CHANGED
@@ -74,6 +74,7 @@ const template = {
74
74
  },
75
75
  {
76
76
  id: 'known',
77
+ where: where(),
77
78
  isA: ['queryable'],
78
79
  evaluator: async ({kms, context, e, callId, toList, flatten, toEValue, resolveEvaluate, objects}) => {
79
80
  const known = await kms.properties.api.getProperty(context.subjects[0], 'property')
@@ -82,6 +83,7 @@ const template = {
82
83
  },
83
84
  {
84
85
  id: 'information',
86
+ where: where(),
85
87
  isA: ['noun'],
86
88
  evaluator: async ({context, e, callId, toList, flatten, toEValue, resolveEvaluate, objects}) => {
87
89
  const properties = objects.askFor
@@ -107,6 +109,7 @@ const template = {
107
109
  },
108
110
  {
109
111
  id: 'askfor_askfor',
112
+ where: where(),
110
113
  isA: ['verb'],
111
114
  words: ['ask'],
112
115
  bridge: `{
@@ -118,7 +121,7 @@ const template = {
118
121
  const argument = context.properties.argument
119
122
  const getValue = (property) => async (args) => {
120
123
  const value = toEValue(await e(property))
121
- if (value.marker == 'answerNotKnown') {
124
+ if (value.marker === 'undefined') {
122
125
  return
123
126
  }
124
127
  return value
@@ -137,7 +140,7 @@ const template = {
137
140
  const query = memoizeAsync(async () => await(gp(await fragments("what is the concept?", { concept: property }))))
138
141
  const compatible_types = property.compatible_types || [property.marker]
139
142
  const matchr = ({context, isA}) => {
140
- return !context.same && !context.evaluate && isA(context, compatible_types)
143
+ return !context.same && isA(context, compatible_types)
141
144
  }
142
145
  objects.askFor.push(property);
143
146
  askForProperty({
package/common/asking.js CHANGED
@@ -26,6 +26,7 @@ const config = {
26
26
  bridges: [
27
27
  {
28
28
  id: "nevermind",
29
+ where: where(),
29
30
  bridge: "{ ...next(operator), complete: true }",
30
31
  semantic: (args) => {
31
32
  const {config, context} = args
@@ -51,6 +52,7 @@ const config = {
51
52
 
52
53
  {
53
54
  id: "whichOnesTestSetup",
55
+ where: where(),
54
56
  scope: "testing",
55
57
  generatorp: async ({context, gs}) => `${context.marker} ${await gs(context.choices)}`,
56
58
  bridge: "{ ...next(operator), choices: after[0] }",
@@ -91,6 +93,7 @@ const config = {
91
93
 
92
94
  {
93
95
  id: "nevermindTestSetup",
96
+ where: where(),
94
97
  scope: "testing",
95
98
  bridge: "{ ...next(operator), type: after[0], postModifiers: ['type'] }",
96
99
  semantic: ({ask, context}) => {
@@ -156,7 +159,9 @@ function getAsk(config) {
156
159
  oneShot: ask.oneShot ?? true,
157
160
  where: semantic.where || ask.where || where(2),
158
161
  source: 'response',
159
- match: (args) => !args.context.isResponse && !args.context.evaluate && !args.context.isControl && semantic.match(args),
162
+ match: async (args) => await args.callOnce(args, 'asking.1', async (args) => {
163
+ return !args.context.isResponse && args.context.topLevel && !args.context.isControl && await semantic.match(args)
164
+ }),
160
165
  apply: async (args) => {
161
166
  setWasApplied(true)
162
167
  await semantic.apply({ ...args, tag: ask.tag })
@@ -187,13 +192,13 @@ function getAsk(config) {
187
192
  matchq = () => !wasAsked,
188
193
  applyq = (args) => {
189
194
  wasAsked = true
190
- return ask.applyq({ ...args, tag: ask.tag })
195
+ return args.stack.wrap(() => ask.applyq({ ...args, tag: ask.tag }), where())
191
196
  }
192
197
  }
193
- if (await matchq(args)) {
198
+ if (await args.stack.wrap(() => matchq(args), where())) {
194
199
  setWasApplied(false)
195
200
  // args.context.motivationKeep = true
196
- const query = await applyq({ ...args, wasAsked: getWasAsked() })
201
+ const query = await args.stack.wrap(() => applyq({ ...args, wasAsked: getWasAsked() }), where())
197
202
  if (typeof query != 'string') {
198
203
  throw new Error(`ask expects the value return from applyq to be a string. ${ask.where}. Instead got ${JSON.stringify(query, null, 2)}.`)
199
204
  }
package/common/avatar.js CHANGED
@@ -27,7 +27,7 @@ const config = {
27
27
  {
28
28
  where: where(),
29
29
  notes: "unknown answer default response for avatar",
30
- match: ({context}) => context.marker == 'answerNotKnown',
30
+ match: ({context}) => context.marker === 'undefined',
31
31
  apply: ({context}) => `I don't know`,
32
32
  },
33
33
  {
@@ -11,6 +11,7 @@
11
11
  {
12
12
  "id": "modifies",
13
13
  "enhanced_associations": false,
14
+ "where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:28",
14
15
  "isA": [
15
16
  "verb"
16
17
  ],
@@ -100,6 +101,7 @@
100
101
  "bridges": [
101
102
  {
102
103
  "id": "isOpenCompound",
104
+ "where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:154",
103
105
  "isA": [
104
106
  "verb"
105
107
  ],
@@ -142,6 +144,7 @@
142
144
  {
143
145
  "id": "modifies",
144
146
  "enhanced_associations": false,
147
+ "where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:28",
145
148
  "isA": [
146
149
  "verb"
147
150
  ],
@@ -160,7 +163,7 @@
160
163
  "bridge": "{ ...next(operator), conceptModifiers: before[0], concept: after[0] }",
161
164
  "semantic": {
162
165
  "notes": "define a modifier",
163
- "where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:34"
166
+ "where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:35"
164
167
  },
165
168
  "check": [
166
169
  "marker",
@@ -217,10 +220,10 @@
217
220
  "generators": [
218
221
  {
219
222
  "notes": "\"fire type, water type and earth type\" to \"fire water and earth type\"",
220
- "where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:84"
223
+ "where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:85"
221
224
  },
222
225
  {
223
- "where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:123"
226
+ "where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:124"
224
227
  }
225
228
  ]
226
229
  },
@@ -682,6 +685,7 @@
682
685
  "bridges": [
683
686
  {
684
687
  "id": "isOpenCompound",
688
+ "where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:154",
685
689
  "isA": [
686
690
  "verb"
687
691
  ],
@@ -690,7 +694,7 @@
690
694
  "is"
691
695
  ],
692
696
  "semantic": {
693
- "where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:163"
697
+ "where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:165"
694
698
  },
695
699
  "enhanced_associations": true,
696
700
  "check": [
package/common/concept.js CHANGED
@@ -25,6 +25,7 @@ const config = {
25
25
  {
26
26
  id: "modifies",
27
27
  enhanced_associations: false,
28
+ where: where(),
28
29
  isA: ['verb'],
29
30
  words: [{ word: 'modifies', number: 'one', flatten: false }, { word: 'modify', number: 'many', flatten: true }],
30
31
  // bridge: "{ ...next(operator), modifiers: before, concept: after[0], flatten: true }"
@@ -150,6 +151,7 @@ const template = {
150
151
  bridges: [
151
152
  {
152
153
  id: 'isOpenCompound',
154
+ where: where(),
153
155
  isA: ['verb'],
154
156
  bridge: `{
155
157
  ...operator,
@@ -39,10 +39,12 @@ const config = {
39
39
  passthrough: true
40
40
  },
41
41
  bridge: "{ ...operator, value: append(before, operator.value) }",
42
+ where: where(),
42
43
  semantic: {
43
44
  match: ({context, namespaced}) => !namespaced.get('conjunction', context, 'atomic'),
44
45
  apply: async ({context, flatten, s}) => {
45
46
  for (const value of flatten(context)) {
47
+ value.topLevel = context.topLevel;
46
48
  await s(value)
47
49
  }
48
50
  }
package/common/control.js CHANGED
@@ -3,8 +3,8 @@ const tests = require('./control.test.json')
3
3
 
4
4
  function initializer({config}) {
5
5
  config.addArgs((args) => ({
6
- callOnce: (args, tag, condition) => {
7
- if (condition(args)) {
6
+ callOnce: async (args, tag, condition) => {
7
+ if (await condition(args)) {
8
8
  const { context } = args
9
9
 
10
10
  if (!context.control) {
@@ -98,6 +98,7 @@ const config = {
98
98
  },
99
99
  {
100
100
  id: "all",
101
+ where: where(),
101
102
  generatorp: ({context}) => 'all',
102
103
  bridge: "{ ...next(operator), number: 'many', quantity: 'all' }"
103
104
  },
@@ -67,15 +67,15 @@
67
67
  ],
68
68
  "semantics": [
69
69
  {
70
- "match": "({context, isA}) => context.evaluate && onOrIs('dayAfterDate', context)",
70
+ "match": "({context, isA}) => onOrIs('dayAfterDate', context)",
71
71
  "apply": "async ({context, isProcess, isTest, kms, isA, e}) => {\n try {\n const now = kms.time.api.now()\n const date = afterOrIs('dayAfterDate', context)\n const afterISO = (await e(date.after)).evalue\n const day_ordinal = date.day.day_ordinal\n const ordinal = date.day.ordinal.value\n context.evalue = dateTimeSelectors_helpers.getNthWeekdayAfterDate(afterISO, day_ordinal, ordinal)\n } catch ( e ) {\n context.evalue = `Implement instatiate for this type of date, ${context.marker}. See the dateTimeSelectors KM ${where()}. ${e}`\n }\n }"
72
72
  },
73
73
  {
74
- "match": "({context, isA}) => context.evaluate && onOrIs('dayOfMonth', context)",
74
+ "match": "({context, isA}) => onOrIs('dayOfMonth', context)",
75
75
  "apply": "({context, isProcess, isTest, kms, isA}) => {\n try {\n const now = kms.time.api.now()\n const date = onOrIs('dayOfMonth', context)\n context.evalue = dateTimeSelectors_helpers.getNthDayOfMonth(removeDatesSuffix(date.day.value), date.day.ordinal.value || 1, removeDatesSuffix(date.month.value), now)\n } catch ( e ) {\n context.evalue = `Implement instatiate for this type of date, ${context.marker}. See the dateTimeSelectors KM ${where()}. ${e}`\n }\n }"
76
76
  },
77
77
  {
78
- "match": "({context, isA}) => {\n if (!context.evaluate) {\n return false\n }\n if (isA(context.marker, 'onDateValue_dates')) {\n return true\n }\n if (isA(context.marker, 'dateTimeSelector')) {\n return true\n }\n }",
78
+ "match": "({context, isA}) => {\n if (isA(context.marker, 'onDateValue_dates')) {\n return true\n }\n if (isA(context.marker, 'dateTimeSelector')) {\n return true\n }\n }",
79
79
  "apply": "({context, isProcess, isTest, kms, isA}) => {\n context.evalue = instantiate(kms, isA, isProcess || isTest || context.isTest, context)\n }"
80
80
  }
81
81
  ],
@@ -94,7 +94,7 @@ const template = {
94
94
  ],
95
95
  semantics: [
96
96
  {
97
- match: ({context, isA}) => context.evaluate && onOrIs('dayAfterDate', context),
97
+ match: ({context, isA}) => onOrIs('dayAfterDate', context),
98
98
  apply: async ({context, isProcess, isTest, kms, isA, e}) => {
99
99
  try {
100
100
  const now = kms.time.api.now()
@@ -109,7 +109,7 @@ const template = {
109
109
  },
110
110
  },
111
111
  {
112
- match: ({context, isA}) => context.evaluate && onOrIs('dayOfMonth', context),
112
+ match: ({context, isA}) => onOrIs('dayOfMonth', context),
113
113
  apply: ({context, isProcess, isTest, kms, isA}) => {
114
114
  try {
115
115
  const now = kms.time.api.now()
@@ -122,9 +122,6 @@ const template = {
122
122
  },
123
123
  {
124
124
  match: ({context, isA}) => {
125
- if (!context.evaluate) {
126
- return false
127
- }
128
125
  if (isA(context.marker, 'onDateValue_dates')) {
129
126
  return true
130
127
  }
@@ -156,7 +153,7 @@ knowledgeModule( {
156
153
  checks: {
157
154
  context: [
158
155
  // defaultContextCheck({ extra: ['date', 'time', 'response', 'after', 'day', 'month', 'year', 'evalue'] }),
159
- defaultContextCheck({ extra: ['date', 'time', 'response', 'after', 'evalue'] }),
156
+ defaultContextCheck({ extra: ['date', 'time', 'after', 'evalue'] }),
160
157
  ],
161
158
  }
162
159
  },
@@ -184,6 +184,7 @@
184
184
  },
185
185
  {
186
186
  "id": "dateEra_dates",
187
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dates.js:129",
187
188
  "isA": [
188
189
  "date_dates"
189
190
  ],
@@ -215,6 +216,7 @@
215
216
  },
216
217
  {
217
218
  "id": "monthDayYearWithSlashes_dates",
219
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dates.js:143",
218
220
  "isA": [
219
221
  "date_dates"
220
222
  ],
@@ -266,6 +268,7 @@
266
268
  },
267
269
  {
268
270
  "id": "monthDay_dates",
271
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dates.js:170",
269
272
  "convolution": true,
270
273
  "localHierarchy": [
271
274
  [
@@ -300,6 +303,7 @@
300
303
  },
301
304
  {
302
305
  "id": "monthYear_dates",
306
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dates.js:181",
303
307
  "convolution": true,
304
308
  "before": [
305
309
  "preposition"
@@ -328,6 +332,7 @@
328
332
  },
329
333
  {
330
334
  "id": "monthDayYear_dates",
335
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dates.js:191",
331
336
  "convolution": true,
332
337
  "before": [
333
338
  "preposition",
@@ -15147,6 +15152,7 @@
15147
15152
  },
15148
15153
  {
15149
15154
  "id": "dateEra_dates",
15155
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dates.js:129",
15150
15156
  "isA": [
15151
15157
  "date_dates"
15152
15158
  ],
@@ -15177,6 +15183,7 @@
15177
15183
  },
15178
15184
  {
15179
15185
  "id": "monthDayYearWithSlashes_dates",
15186
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dates.js:143",
15180
15187
  "isA": [
15181
15188
  "date_dates"
15182
15189
  ],
@@ -15227,6 +15234,7 @@
15227
15234
  },
15228
15235
  {
15229
15236
  "id": "monthDay_dates",
15237
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dates.js:170",
15230
15238
  "convolution": true,
15231
15239
  "localHierarchy": [
15232
15240
  [
@@ -15260,6 +15268,7 @@
15260
15268
  },
15261
15269
  {
15262
15270
  "id": "monthYear_dates",
15271
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dates.js:181",
15263
15272
  "convolution": true,
15264
15273
  "before": [
15265
15274
  "preposition"
@@ -15287,6 +15296,7 @@
15287
15296
  },
15288
15297
  {
15289
15298
  "id": "monthDayYear_dates",
15299
+ "where": "/home/dev/code/theprogrammablemind/kms/common/dates.js:191",
15290
15300
  "convolution": true,
15291
15301
  "before": [
15292
15302
  "preposition",
package/common/dates.js CHANGED
@@ -126,6 +126,7 @@ const template = {
126
126
  },
127
127
  {
128
128
  id: 'dateEra_dates',
129
+ where: where(),
129
130
  isA: ['date_dates'],
130
131
  convolution: true,
131
132
  bridge: "{ ...next(after[0]), era: after[1], interpolate: concat(after[0].interpolate, ' ${era}') }",
@@ -139,6 +140,7 @@ const template = {
139
140
  },
140
141
  {
141
142
  id: 'monthDayYearWithSlashes_dates',
143
+ where: where(),
142
144
  isA: ['date_dates'],
143
145
  before: ['preposition'],
144
146
  separators: "||||",
@@ -165,6 +167,7 @@ const template = {
165
167
  },
166
168
  {
167
169
  id: 'monthDay_dates',
170
+ where: where(),
168
171
  convolution: true,
169
172
  localHierarchy: [['ordinal', 'dayNumber_dates']],
170
173
  before: ['preposition'],
@@ -175,6 +178,7 @@ const template = {
175
178
  },
176
179
  {
177
180
  id: 'monthYear_dates',
181
+ where: where(),
178
182
  convolution: true,
179
183
  before: ['preposition'],
180
184
  isA: ['date_dates'],
@@ -184,6 +188,7 @@ const template = {
184
188
  },
185
189
  {
186
190
  id: 'monthDayYear_dates',
191
+ where: where(),
187
192
  convolution: true,
188
193
  before: ['preposition', 'monthDay_dates'],
189
194
  isA: ['date_dates'],
@@ -8,11 +8,13 @@
8
8
  "bridges": [
9
9
  {
10
10
  "id": "setdebugbreak",
11
+ "where": "/home/dev/code/theprogrammablemind/kms/common/debug.js:16",
11
12
  "bridge": "{\n ...next(operator),\n tag: after[0]\n }",
12
13
  "semantic": "({context, debug}) => {\n debug.hit(context.tag.word)\n }"
13
14
  },
14
15
  {
15
16
  "id": "debugger",
17
+ "where": "/home/dev/code/theprogrammablemind/kms/common/debug.js:27",
16
18
  "semantic": "(args) => {\n debugger // eslint-disable-line no-debugger\n debugger // eslint-disable-line no-debugger\n }"
17
19
  }
18
20
  ]
@@ -28,10 +30,12 @@
28
30
  "bridges": [
29
31
  {
30
32
  "id": "setdebugbreak",
33
+ "where": "/home/dev/code/theprogrammablemind/kms/common/debug.js:16",
31
34
  "bridge": "{\n ...next(operator),\n tag: after[0]\n }"
32
35
  },
33
36
  {
34
- "id": "debugger"
37
+ "id": "debugger",
38
+ "where": "/home/dev/code/theprogrammablemind/kms/common/debug.js:27"
35
39
  }
36
40
  ]
37
41
  }
package/common/debug.js CHANGED
@@ -13,6 +13,7 @@ const template = {
13
13
  bridges: [
14
14
  {
15
15
  id: 'setdebugbreak',
16
+ where: where(),
16
17
  bridge: `{
17
18
  ...next(operator),
18
19
  tag: after[0]
@@ -23,6 +24,7 @@ const template = {
23
24
  },
24
25
  {
25
26
  id: 'debugger',
27
+ where: where(),
26
28
  semantic: (args) => {
27
29
  debugger // eslint-disable-line no-debugger
28
30
  debugger // eslint-disable-line no-debugger
@@ -110,6 +110,7 @@ const config = {
110
110
  },
111
111
  {
112
112
  id: 'makeObject',
113
+ where: where(),
113
114
  bridge: "{ ...next(operator), object: after[0] }",
114
115
  enhanced_associations: false,
115
116
  generatorp: async ({context, gp}) => `${context.word} ${await gp(context.object)}`,
@@ -119,6 +120,7 @@ const config = {
119
120
  },
120
121
  {
121
122
  id: 'setIdSuffix',
123
+ where: where(),
122
124
  enhanced_associations: false,
123
125
  bridge: "{ ...next(operator), suffix: after[0] }",
124
126
  generatorp: async ({context, gp}) => `${context.word} ${await gp(context.suffix)}`,
@@ -128,6 +130,7 @@ const config = {
128
130
  },
129
131
  {
130
132
  id: 'resetIdSuffix',
133
+ where: where(),
131
134
  semantic: ({context, api}) => {
132
135
  api.setIdSuffix('')
133
136
  }
@@ -301,13 +304,13 @@ const config = {
301
304
  {
302
305
  where: where(),
303
306
  notes: "unknown answer default response",
304
- match: ({context, namespaced}) => context.marker == 'answerNotKnown' && context.brief,
307
+ match: ({context, namespaced}) => context.marker === 'undefined' && context.brief,
305
308
  apply: ({context}) => `not known`,
306
309
  },
307
310
  {
308
311
  where: where(),
309
312
  notes: "unknown answer default response",
310
- match: ({context}) => context.marker == 'answerNotKnown',
313
+ match: ({context}) => context.marker === 'undefined',
311
314
  apply: ({context}) => `that is not known`,
312
315
  },
313
316
  {
@@ -446,7 +449,7 @@ const config = {
446
449
  notes: 'x is y',
447
450
  match: ({context, hierarchy}) => hierarchy.isA(context.marker, 'is') && !context.evalue,
448
451
  apply: async ({isA, context, g, gp, debug, gr, callId}) => {
449
- if ((context.two.evalue || {}).marker == 'answerNotKnown') {
452
+ if ((context.two.evalue || {}).marker === 'undefined') {
450
453
  return await g(context.two.evalue)
451
454
  }
452
455
 
@@ -454,8 +457,8 @@ const config = {
454
457
  return `${await gp(context.one)} ${isMany(context.one) || isMany(context.two) || isMany(context) ? "are" : "is"} ${await g(context.two)}`
455
458
  }
456
459
 
457
- if (context.response) {
458
- context = context.response
460
+ if (context.evalue) {
461
+ context = context.evalue
459
462
  }
460
463
 
461
464
  function hasFocus(property) {
@@ -575,6 +578,7 @@ const config = {
575
578
  apply: async ({context, s, log, km, objects, e, toEValue}) => {
576
579
  const one = context.one;
577
580
  const two = context.two;
581
+
578
582
  let query, value;
579
583
  if (one.query) {
580
584
  query = one;
@@ -591,7 +595,7 @@ const config = {
591
595
  return
592
596
  }
593
597
 
594
- if (toEValue(instance)?.marker == 'answerNotKnown') {
598
+ if (toEValue(instance)?.marker === 'undefined') {
595
599
  context.evalue = instance
596
600
  context.isResponse = true
597
601
  return