tpmkms_4wp 9.5.1 → 9.6.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.
Files changed (122) hide show
  1. package/common/animals.instance.json +21 -61
  2. package/common/asking.js +116 -106
  3. package/common/avatar.test.json +1001 -860
  4. package/common/can.instance.json +2174 -0
  5. package/common/can.js +254 -0
  6. package/common/can.test.json +51307 -0
  7. package/common/characters.js +5 -5
  8. package/common/colors.instance.json +12 -12
  9. package/common/comparable.instance.json +3 -3
  10. package/common/concept.js +25 -27
  11. package/common/concept.test.json +180 -144
  12. package/common/conjunction.js +13 -5
  13. package/common/conjunction.test.json +32 -42
  14. package/common/crew.instance.json +196 -160
  15. package/common/crew.js +1 -1
  16. package/common/crew.test.json +4148 -3324
  17. package/common/currency.js +1 -1
  18. package/common/dateTimeSelectors.instance.json +2 -2
  19. package/common/dateTimeSelectors.js +3 -3
  20. package/common/dateTimeSelectors.test.json +76935 -35739
  21. package/common/dates.instance.json +3 -3
  22. package/common/dates.test.json +284 -287
  23. package/common/dialogues.js +41 -119
  24. package/common/dialogues.test.json +1171 -996
  25. package/common/dimension.instance.json +21369 -557
  26. package/common/dimension.js +148 -54
  27. package/common/dimension.test.json +8753 -3495
  28. package/common/drone.instance.json +23712 -0
  29. package/common/drone.js +448 -0
  30. package/common/drone.test.json +66665 -0
  31. package/common/edible.instance.json +32 -32
  32. package/common/emotions.instance.json +75 -76
  33. package/common/emotions.js +1 -1
  34. package/common/emotions.test.json +242 -174
  35. package/common/english_helpers.js +336 -0
  36. package/common/errors.js +6 -6
  37. package/common/evaluate.js +2 -2
  38. package/common/events.js +8 -8
  39. package/common/fastfood.instance.json +389 -245
  40. package/common/fastfood.js +11 -11
  41. package/common/fastfood.test.json +6970 -6829
  42. package/common/formulas.instance.json +1 -1
  43. package/common/formulas.js +1 -1
  44. package/common/gdefaults.js +111 -17
  45. package/common/help.js +12 -12
  46. package/common/help.test.json +65 -11
  47. package/common/helpers/concept.js +1 -1
  48. package/common/helpers/conjunction.js +54 -44
  49. package/common/helpers/dateTimeSelectors.js +2 -2
  50. package/common/helpers/dialogues.js +7 -2
  51. package/common/helpers/formulas.js +13 -11
  52. package/common/helpers/menus.js +12 -12
  53. package/common/helpers/meta.js +9 -9
  54. package/common/helpers/properties.js +185 -62
  55. package/common/helpers.js +167 -48
  56. package/common/hierarchy.js +6 -4
  57. package/common/kirk.instance.json +1 -1
  58. package/common/kirk.test.json +600 -424
  59. package/common/latin.instance.json +12 -12
  60. package/common/latin.js +9 -9
  61. package/common/length.instance.json +27612 -2890
  62. package/common/length.js +6 -1
  63. package/common/length.test.json +45315 -3925
  64. package/common/math.instance.json +29 -29
  65. package/common/math.js +47 -46
  66. package/common/menus.instance.json +7 -10
  67. package/common/menus.js +2 -9
  68. package/common/meta.js +77 -60
  69. package/common/nameable.js +20 -13
  70. package/common/nameable.test.json +436 -0
  71. package/common/numbers.js +1 -1
  72. package/common/ordering.instance.json +87 -19
  73. package/common/ordering.js +1 -1
  74. package/common/ordering.test.json +835 -417
  75. package/common/people.instance.json +96 -348
  76. package/common/people.js +6 -4
  77. package/common/people.test.json +4135 -3606
  78. package/common/pipboy.instance.json +17 -17
  79. package/common/pipboy.js +2 -3
  80. package/common/pokemon.instance.json +13 -13
  81. package/common/pokemon.js +1 -1
  82. package/common/pressure.instance.json +3579 -1610
  83. package/common/pressure.test.json +433 -477
  84. package/common/properties.instance.json +6 -17
  85. package/common/properties.js +25 -7
  86. package/common/properties.test.json +9565 -6951
  87. package/common/rates.instance.json +59 -0
  88. package/common/rates.js +97 -0
  89. package/common/rates.test.json +27702 -0
  90. package/common/reminders.instance.json +4 -4
  91. package/common/reminders.js +5 -5
  92. package/common/reminders.test.json +64635 -25787
  93. package/common/reports.instance.json +3 -3
  94. package/common/reports.js +18 -16
  95. package/common/scorekeeper.js +6 -6
  96. package/common/sdefaults.js +22 -2
  97. package/common/spock.instance.json +1 -1
  98. package/common/spock.test.json +606 -430
  99. package/common/stgame.js +1 -1
  100. package/common/stm.js +17 -6
  101. package/common/tell.js +1 -1
  102. package/common/temperature.instance.json +3659 -1690
  103. package/common/temperature.test.json +433 -477
  104. package/common/tester.js +3 -3
  105. package/common/time.instance.json +24762 -0
  106. package/common/time.js +137 -141
  107. package/common/time.test.json +31876 -3757
  108. package/common/tokenize.js +5 -2
  109. package/common/ui.instance.json +2 -5
  110. package/common/ui.js +1 -8
  111. package/common/weight.instance.json +10360 -4078
  112. package/common/weight.test.json +2601 -2263
  113. package/common/words.instance.json +9 -0
  114. package/common/words.js +53 -0
  115. package/common/words.test.json +2 -0
  116. package/common/wp.instance.json +408 -8
  117. package/common/wp.js +8 -4
  118. package/common/wp.test.json +7385 -6906
  119. package/main.js +4 -2
  120. package/package.json +20 -5
  121. package/common/listener.js +0 -50
  122. package/common/listener.test.json +0 -142
@@ -16,9 +16,7 @@ const dialogues_tests = require('./dialogues.test.json')
16
16
  const { defaultObjectCheck, defaultContextCheck, indent, focus } = require('./helpers')
17
17
  const pluralize = require('pluralize')
18
18
 
19
- const api = new API()
20
-
21
- const warningIsANotImplemented = (log, context) => {
19
+ function warningIsANotImplemented(log, context) {
22
20
  const description = 'WARNING from Dialogues KM: For semantics in order to handle sentences of type "x is y?", set the response to what you like.'
23
21
  const match = `({context, hierarchy}) => hierarchy.isA(context.marker, 'is') && context.query && <other conditions as you like>`
24
22
  const apply = `({context}) => <do stuff...>; context.evalue = <value>`
@@ -27,7 +25,7 @@ const warningIsANotImplemented = (log, context) => {
27
25
  log(indent(message, 4))
28
26
  }
29
27
 
30
- const warningSameNotEvaluated = (log, one) => {
28
+ function warningSameNotEvaluated(log, one) {
31
29
  const description = 'WARNING from Dialogues KM: For the "X is Y" type phrase implement a same handler.'
32
30
  const match = `({context}) => context.marker == '${one.marker}' && context.same && <other conditions as you like>`
33
31
  const apply = '({context}) => <do stuff... context.same is the other value>; context.sameWasProcessed = true'
@@ -36,7 +34,7 @@ const warningSameNotEvaluated = (log, one) => {
36
34
  log(indent(message, 4))
37
35
  }
38
36
 
39
- const listorama = (type) => {
37
+ function listorama(type) {
40
38
  return [
41
39
  { context: [[type, 0], ['list', 0], [type, 0]], choose: 0 },
42
40
  { context: [[type, 1], ['list', 0], [type, 0]], choose: 0 },
@@ -56,38 +54,23 @@ const config = {
56
54
 
57
55
  "(([queryable]) [is|] ([queryable|]))",
58
56
  "([isQuery|] ([queryable]) ([queryable]))",
59
- // "(([queryable]) [is:isEdBridge|is,are] ([isEdAble|]))",
60
57
  // who is the car owned by
61
58
  "(([queryable]) [(<isEd|> ([isEdAble|]))])",
62
59
 
63
- /* TODO investigate this:
64
- {"pattern":"(([ownee])^ <owned|owned> ([by] ([owner])?))","uuid":"people1"}
65
- {"pattern":"(([isEdee])^ <isEdAble|> ([by] ([isEder])?))","uuid":"dialogues2"}
66
- */
67
60
  "(([isEdee])^ <isEdAble|> ([by] ([isEder])?))",
68
61
  "([isEdee|])",
69
62
  "([isEder|])",
70
63
 
71
- // "([nevermind])",
72
- // { pattern: "([nevermindTestSetup] (allowed))", development: true },
73
64
  "([why])",
74
65
  "([reason])",
75
- // "([thisitthat|])",
76
- // "([it])",
77
- // "([this])",
78
- // "([that])",
79
66
 
80
67
  "(<what> ([whatAble|]))",
81
68
  "([what:optional])",
82
- // "(<the|> ([theAble|]))",
83
- // "(<a|a,an> ([theAble|]))",
84
- // "([unknown])",
85
69
 
86
70
  "([be] ([briefOrWordy|]))",
87
71
 
88
72
  "([([canBeQuestion])])",
89
73
  "(([canBeQuestion/1,2]) <questionMark|>)",
90
- // "(([is/2]) <questionMark|>)",
91
74
 
92
75
  "(([what]) [(<does|> ([doesAble|]))])",
93
76
  "([canBeDoQuestion])",
@@ -101,46 +84,29 @@ const config = {
101
84
 
102
85
  "([to] ([toAble|]))",
103
86
  ],
104
- associations: {
105
- positive: [
106
- { context: [['unknown', 0], ['isEdAble', 0]], choose: 1 },
107
- { context: [['isQuery', 0], ['a', 0], ['unknown', 0], ['a', 0], ['unknown', 0]], choose: { index: 0, increment: true } },
108
-
109
- { context: [["unknown",0],["isEd",0],["isEdAble",0],["by",0],["unknown",0]], choose: { index: 0, increment: true } },
110
- { context: [["unknown",0],["isEd",0],["isEdAble",0],["by",1]], choose: { index: 0, increment: true } },
111
- { context: [["unknown",0],["isEd",0],["isEdAble",0]], choose: { index: 0, increment: true } },
112
-
113
-
114
- // ...listorama('unknown'),
115
- // ...listorama('queryable'),
116
- { context: [['unknown', 0], ['list', 0], ['unknown', 0]], choose: 0 },
117
- { context: [['unknown', 0], ['list', 0], ['unknown', 1]], choose: 0 },
118
- { context: [['unknown', 1], ['list', 0], ['unknown', 0]], choose: 0 },
119
- { context: [['unknown', 1], ['list', 0], ['unknown', 1]], choose: 0 },
120
-
121
- { context: [['queryable', 0], ['list', 0], ['unknown', 0]], choose: 1 },
122
- { context: [['queryable', 0], ['list', 0], ['unknown', 1]], choose: 1 },
123
- { context: [['queryable', 1], ['list', 0], ['unknown', 0]], choose: 1 },
124
- { context: [['queryable', 1], ['list', 0], ['unknown', 1]], choose: 1 },
125
-
126
- { context: [['unknown', 0], ['list', 0], ['queryable', 0]], choose: 2 },
127
- { context: [['unknown', 0], ['list', 0], ['queryable', 1]], choose: 2 },
128
- { context: [['unknown', 1], ['list', 0], ['queryable', 0]], choose: 2 },
129
- { context: [['unknown', 1], ['list', 0], ['queryable', 1]], choose: 2 },
130
-
131
- { context: [['queryable', 0], ['list', 0], ['queryable', 0]], choose: 0 },
132
- { context: [['queryable', 0], ['list', 0], ['queryable', 1]], choose: 0 },
133
- { context: [['queryable', 1], ['list', 0], ['queryable', 0]], choose: 0 },
134
- { context: [['queryable', 1], ['list', 0], ['queryable', 1]], choose: 0 },
135
- ]
136
- },
137
87
  bridges: [
138
88
  {
139
89
  id: 'thatVerb',
140
90
  before: ['verb'],
141
- // bridge: "{ ...after[0], verb: after[0], that: operator, generate: ['that', 'verb'], localPriorities: { before: [\"verb\"] }, bridge_override: { operator: after[0].marker, bridge: '{ ...bridge.subject, postModifiers: [\"conditions\"], generate: append(before[0].generate, concatm(\"thatClause.\", operator.generate)), thatClause: bridge, conditions: append(after[0].conditions, [bridge]) }' } }",
142
- // bridge: "{ ...after[0], verb: after[0], that: operator, generate: ['that', 'verb'], localPriorities: { before: [\"verb\"] }, bridge_override: { operator: after[0].marker, bridge: '{ ...bridge.subject, postModifiers: [\"conditions\"], generate: concatm(\"thatClause.\", bridge.generate), thatClause: bridge, conditions: append(bridge.subject.conditions, [bridge]) }' } }",
143
- bridge: "{ ...after[0], verb: after[0], that: operator, generate: ['that', 'verb'], localPriorities: { actLike: [\"subordinatedVerb\", 0] }, bridge_override: { operator: after[0].marker, bridge: '{ ...bridge.subject, postModifiers: [\"conditions\"], modifiers: [], generate: concatm(\"thatClause.\", bridge.generate), thatClause: bridge, conditions: append(bridge.subject.conditions, [bridge]) }' } }",
91
+ bridge: `
92
+ {
93
+ ...after[0],
94
+ verb: after[0],
95
+ that: operator,
96
+ generate: ['that', 'verb'],
97
+ localPriorities: { actLike: ["subordinatedVerb", 0] },
98
+ bridge_override: {
99
+ operator: after[0].marker,
100
+ bridge: '{
101
+ ...bridge.subject,
102
+ postModifiers: ["conditions"],
103
+ modifiers: [],
104
+ generate: concatm("thatClause.", bridge.generate),
105
+ thatClause: bridge,
106
+ conditions: append(bridge.subject.conditions, [bridge])
107
+ }'
108
+ }
109
+ }`,
144
110
  },
145
111
 
146
112
  {
@@ -203,7 +169,16 @@ const config = {
203
169
  },
204
170
  { id: "toAble" },
205
171
 
206
- { id: "be", level: 0, bridge: "{ ...next(operator), type: after[0] }" },
172
+ {
173
+ id: "be",
174
+ level: 0,
175
+ bridge: `{
176
+ ...next(operator),
177
+ form: 'infinitive',
178
+ type: after[0]
179
+ }`
180
+ },
181
+
207
182
  { id: "briefOrWordy" },
208
183
 
209
184
  { id: "yesno" },
@@ -246,38 +221,6 @@ const config = {
246
221
  { id: "doesAble", level: 0, bridge: "{ ...next(operator) }" },
247
222
  { id: "doesAble", level: 1, bridge: "{ ...next(operator), before: before[0] }" },
248
223
  { id: "does", level: 0, bridge: "{ query: true, what: operator.marker, ...context, number: operator.number, object.number: operator.number }*" },
249
-
250
- /*
251
- {
252
- id: 'the',
253
- level: 0,
254
- bridge: '{ ...after[0], focusableForPhrase: true, pullFromContext: true, concept: true, wantsValue: true, determiner: "the", modifiers: append(["determiner"], after[0].modifiers)}'
255
- },
256
- {
257
- id: "a",
258
- level: 0,
259
- // bridge: "{ ...after[0], pullFromContext: false, instance: true, concept: true, number: 'one', wantsValue: true, determiner: operator, modifiers: append(['determiner'], after[0].modifiers) }"
260
- bridge: "{ ...after[0], pullFromContext: false, concept: true, number: 'one', wantsValue: true, determiner: operator, modifiers: append(['determiner'], after[0].modifiers) }"
261
- },
262
- */
263
- /*
264
- {
265
- id: "theAble",
266
- children: ['noun'],
267
- bridge: "{ ...next(operator) }"
268
- },
269
- */
270
-
271
- // TODO make this hierarchy thing work
272
- /*
273
- {
274
- id: "thisitthat",
275
- level: 0,
276
- isA: ['queryable'],
277
- before: ['verby'],
278
- bridge: "{ ...next(operator) }"
279
- },
280
- */
281
224
  {
282
225
  id: "why",
283
226
  level: 0,
@@ -287,31 +230,10 @@ const config = {
287
230
  id: "reason",
288
231
  isA: ['theAble', 'queryable'],
289
232
  },
290
- /*
291
- {
292
- id: "it",
293
- level: 0,
294
- isA: ['thisitthat'],
295
- bridge: "{ ...next(operator), pullFromContext: true, unknown: true, determined: true }"
296
- },
297
- {
298
- id: "this",
299
- level: 0,
300
- isA: ['thisitthat'],
301
- bridge: "{ ...next(operator), unknown: true, pullFromContext: true }"
302
- },
303
- {
304
- id: "that",
305
- level: 0,
306
- isA: ['thisitthat'],
307
- bridge: "{ ...next(operator), unknown: true, pullFromContext: true }"
308
- },
309
- */
310
233
  ],
311
234
  words: {
312
235
  "literals": {
313
236
  "?": [{"id": "questionMark", "initial": "{}" }],
314
- // "the": [{"id": "the", "initial": "{ modifiers: [] }" }],
315
237
  "who": [{"id": "what", "initial": "{ modifiers: [], query: true }" }],
316
238
  "yes": [{"id": "yesno", "initial": "{ value: true }" }],
317
239
  "no": [{"id": "yesno", "initial": "{ value: false }" }],
@@ -320,6 +242,7 @@ const config = {
320
242
  "does": [{"id": "does", "initial": "{ number: 'one' }" }],
321
243
  "do": [{"id": "does", "initial": "{ number: 'many' }" }],
322
244
  "is": [
245
+ {"id": "be", "initial": "{ form: 'infinitive' }" },
323
246
  {"id": "is", "initial": "{ number: 'one' }" },
324
247
  {"id": "isQuery", "initial": "{ number: 'one' }" },
325
248
  {"id": "isEd", "initial": "{ number: 'one' }" }
@@ -347,12 +270,9 @@ const config = {
347
270
  ['it', 'pronoun'],
348
271
  ['this', 'pronoun'],
349
272
  ['questionMark', 'punctuation'],
350
- // ['questionMark', 'isEd'],
351
273
  ['a', 'article'],
352
274
  ['the', 'article'],
353
- // ['unknown', 'theAble'],
354
275
  ['theAble', 'queryable'],
355
- // ['unknown', 'queryable'],
356
276
  ['it', 'queryable'],
357
277
  ['what', 'queryable'],
358
278
  ['whatAble', 'queryable'],
@@ -369,11 +289,13 @@ const config = {
369
289
  {
370
290
  where: where(),
371
291
  notes: "handle making responses brief",
372
- match: ({context, objects}) => (context.topLevel || context.isResponse) && objects.brief && !context.briefWasRun,
292
+ match: ({context, objects, callId}) => (context.topLevel || context.isResponse) && objects.brief && !context.briefWasRun,
373
293
  apply: async ({context, g}) => {
374
294
  const focussed = focus(context)
375
295
  context.briefWasRun = true
376
- return await g(focussed)
296
+ const result = await g(focussed)
297
+ context.briefWasRun = false
298
+ return result
377
299
  },
378
300
  priority: -2,
379
301
  },
@@ -393,7 +315,7 @@ const config = {
393
315
  where: where(),
394
316
  notes: "be brief or wordy",
395
317
  match: ({context}) => context.marker == 'be',
396
- apply: ({context}) => `be ${context.type.word}`,
318
+ apply: ({context}) => `be ${context.type?.word}`,
397
319
  },
398
320
  /*
399
321
  {
@@ -528,7 +450,7 @@ const config = {
528
450
  return `${await gp(context.one)} ${isMany(context.one) || isMany(context.two) || isMany(context) ? "are" : "is"} ${await g(context.two)}`
529
451
  }
530
452
 
531
- const hasFocus = (property) => {
453
+ function hasFocus(property) {
532
454
  if (context.focusableForPhrase) {
533
455
  return true
534
456
  }
@@ -554,7 +476,7 @@ const config = {
554
476
  } else {
555
477
  // TODO fix this using the assumed and that whole mess. change isResponse to useValue
556
478
  if (context.isResponse) {
557
- return `${await gp(context.one, { responding: true })} ${isMany(context.one) || isMany(context.two) || isMany(context) ? "are" : "is"} ${await g(context.two)}`
479
+ return `${await gp(context.one, { assumed: { responding: true } })} ${isMany(context.one) || isMany(context.two) || isMany(context) ? "are" : "is"} ${await g(context.two)}`
558
480
  } else {
559
481
  return `${await gp(context.one)} ${isMany(context.one) || isMany(context.two) || isMany(context) ? "are" : "is"} ${await gr(context.two)}`
560
482
  }
@@ -788,7 +710,7 @@ const config = {
788
710
  ],
789
711
  };
790
712
 
791
- const initializer = ({objects, config, isModule}) => {
713
+ function initializer({objects, config, isModule}) {
792
714
  /* TODO add this beck in. some stuff from config needs to be here
793
715
  config.addArgs((args) => ({
794
716
  e: (context) => config.api.getEvaluator(args.s, args.log, context),