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
@@ -7,7 +7,7 @@ const { table } = require('table')
7
7
  const _ = require('lodash')
8
8
  const characters_tests = require('./characters.test.json')
9
9
 
10
- const getHelp = (config, indent=2) => {
10
+ function getHelp(config, indent=2) {
11
11
  indent = ' '.repeat(indent)
12
12
  let help = ''
13
13
  help += `${indent}NAME: ${config.name}\n`
@@ -42,8 +42,8 @@ const config = {
42
42
  ],
43
43
  "words": {
44
44
  "literals": {
45
- "sally": [{"id": "character", development: true, "initial": "{ value: 'sally' }" }],
46
- "bob": [{"id": "character", development: true, "initial": "{ value: 'bob' }" }],
45
+ "sally": [{"id": "character", scope: "testing", "initial": "{ value: 'sally' }" }],
46
+ "bob": [{"id": "character", scope: "testing", "initial": "{ value: 'bob' }" }],
47
47
  },
48
48
  },
49
49
 
@@ -167,13 +167,13 @@ class Bob {
167
167
  }
168
168
  }
169
169
 
170
- const initializeApi = (config, api) => {
170
+ function initializeApi(config, api) {
171
171
  const name = api.getName();
172
172
  config.addWord(name, {"id": "character", "initial": "{ value: '" + name + `', api: '${name}'}` })
173
173
  }
174
174
 
175
175
 
176
- const initializer = async ({isModule, km}) => {
176
+ async function initializer({isModule, km}) {
177
177
  if (!isModule) {
178
178
  const timeKM = await createTimeKM()
179
179
  const currencyKM = await createCurrencyKM()
@@ -1080,7 +1080,7 @@
1080
1080
  "text": "dark and light",
1081
1081
  "range": {
1082
1082
  "start": 0,
1083
- "end": 28
1083
+ "end": 13
1084
1084
  },
1085
1085
  "types": [
1086
1086
  "list",
@@ -3219,7 +3219,7 @@
3219
3219
  "text": "red, pink, orange, yellow, purple, green, blue, brown, white and gray",
3220
3220
  "range": {
3221
3221
  "start": 0,
3222
- "end": 79
3222
+ "end": 68
3223
3223
  },
3224
3224
  "types": [
3225
3225
  "list",
@@ -9171,7 +9171,7 @@
9171
9171
  "word": "crimson",
9172
9172
  "range": {
9173
9173
  "start": 0,
9174
- "end": 15
9174
+ "end": 6
9175
9175
  },
9176
9176
  "dead": true,
9177
9177
  "types": [
@@ -10574,7 +10574,7 @@
10574
10574
  "text": "gold and khaki",
10575
10575
  "range": {
10576
10576
  "start": 0,
10577
- "end": 25
10577
+ "end": 13
10578
10578
  },
10579
10579
  "types": [
10580
10580
  "list",
@@ -12487,7 +12487,7 @@
12487
12487
  "text": "lavender, violet, magenta and indigo",
12488
12488
  "range": {
12489
12489
  "start": 0,
12490
- "end": 47
12490
+ "end": 35
12491
12491
  },
12492
12492
  "types": [
12493
12493
  "list",
@@ -15284,7 +15284,7 @@
15284
15284
  "text": "lime, chartruese, olive and teal",
15285
15285
  "range": {
15286
15286
  "start": 0,
15287
- "end": 43
15287
+ "end": 31
15288
15288
  },
15289
15289
  "types": [
15290
15290
  "list",
@@ -18376,7 +18376,7 @@
18376
18376
  "text": "aqua, cyan, aquamarine, turquoise and navy",
18377
18377
  "range": {
18378
18378
  "start": 0,
18379
- "end": 52
18379
+ "end": 41
18380
18380
  },
18381
18381
  "types": [
18382
18382
  "list",
@@ -21870,7 +21870,7 @@
21870
21870
  "text": "tan, sienna and maroon",
21871
21871
  "range": {
21872
21872
  "start": 0,
21873
- "end": 33
21873
+ "end": 21
21874
21874
  },
21875
21875
  "types": [
21876
21876
  "list",
@@ -24771,7 +24771,7 @@
24771
24771
  "text": "snow, azure, beige and ivory",
24772
24772
  "range": {
24773
24773
  "start": 0,
24774
- "end": 39
24774
+ "end": 27
24775
24775
  },
24776
24776
  "types": [
24777
24777
  "list",
@@ -27986,7 +27986,7 @@
27986
27986
  "text": "silver and black",
27987
27987
  "range": {
27988
27988
  "start": 0,
27989
- "end": 26
27989
+ "end": 15
27990
27990
  },
27991
27991
  "types": [
27992
27992
  "list",
@@ -30451,7 +30451,7 @@
30451
30451
  "end": 25
30452
30452
  },
30453
30453
  "dead": true,
30454
- "modifiers": [
30454
+ "conceptModifiers": [
30455
30455
  {
30456
30456
  "value": "brightness_colors",
30457
30457
  "number": "one",
@@ -32660,7 +32660,7 @@
32660
32660
  "end": 17
32661
32661
  },
32662
32662
  "dead": true,
32663
- "modifiers": [
32663
+ "conceptModifiers": [
32664
32664
  {
32665
32665
  "value": "hex",
32666
32666
  "unknown": true,
@@ -352,7 +352,7 @@
352
352
  "end": 21
353
353
  },
354
354
  "dead": true,
355
- "modifiers": [
355
+ "conceptModifiers": [
356
356
  {
357
357
  "value": "sort",
358
358
  "unknown": true,
@@ -963,7 +963,7 @@
963
963
  "word": "ascending",
964
964
  "range": {
965
965
  "start": 0,
966
- "end": 27
966
+ "end": 8
967
967
  },
968
968
  "dead": true,
969
969
  "types": [
@@ -1792,7 +1792,7 @@
1792
1792
  "word": "descending",
1793
1793
  "range": {
1794
1794
  "start": 0,
1795
- "end": 28
1795
+ "end": 9
1796
1796
  },
1797
1797
  "dead": true,
1798
1798
  "types": [
package/common/concept.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const { knowledgeModule, flatten, where, Digraph } = require('./runtime').theprogrammablemind
2
- const { defaultContextCheck } = require('./helpers')
2
+ const { defaultContextCheck, defaultContextCheckProperties } = require('./helpers')
3
3
  const { API }= require('./helpers/concept')
4
4
  const dialogues = require('./dialogues.js')
5
5
  const concept_tests = require('./concept.test.json')
@@ -27,7 +27,26 @@ config = {
27
27
  isA: ['verb'],
28
28
  words: [{ word: 'modifies', number: 'one', flatten: false }, { word: 'modify', number: 'many', flatten: true }],
29
29
  // bridge: "{ ...next(operator), modifiers: before, concept: after[0], flatten: true }"
30
- bridge: "{ ...next(operator), modifiers: before[0], concept: after[0] }"
30
+ bridge: "{ ...next(operator), conceptModifiers: before[0], concept: after[0] }",
31
+ semantic: {
32
+ notes: 'define a modifier',
33
+ where: where(),
34
+ apply: ({config, query, km, context}) => {
35
+ let modifiers
36
+ if (context.literally) {
37
+ literalModifiers = context.conceptModifiers[0]
38
+ // modifiers = literalModifiers.value.map(modifier => modifier.value)
39
+ modifiers = literalModifiers.value
40
+ modifiers = modifiers.slice(0, -1).concat([literalModifiers.marker]).concat(modifiers.slice(-1))
41
+ } else {
42
+ modifiers = context.conceptModifiers
43
+ // modifiers = context.modifiers.map(modifier => modifier.value)
44
+ }
45
+ // km('concept').api.kindOfConcept({ config, modifiers, object: context.concept.value || context.concept.marker })
46
+ km('concept').api.kindOfConcept({ config, modifiers, object: context.concept })
47
+ }
48
+ },
49
+ check: defaultContextCheckProperties(['concept', 'conceptModifiers']),
31
50
  },
32
51
  { id: "literally", bridge: "{ ...after[0], flatten: false, literally: true }" },
33
52
  { id: "concept" },
@@ -62,7 +81,7 @@ config = {
62
81
  },
63
82
  */
64
83
  where: where(),
65
- match: ({context}) => {
84
+ match: ({context, callId}) => {
66
85
  if (!context.paraphrase) {
67
86
  return
68
87
  }
@@ -103,39 +122,18 @@ config = {
103
122
  match: ({context}) => context.marker == 'modifies' && context.paraphrase,
104
123
  apply: async ({context, gp, gw}) => {
105
124
  const modifiers = []
106
- for (modifier of context.modifiers) {
125
+ for (modifier of context.conceptModifiers) {
107
126
  modifiers.push(await gp(modifier))
108
127
  }
109
128
  if (context.literally) {
110
- return `${modifiers.join(" ")} literally ${await gw(context, { number: context.modifiers[context.modifiers.length - 1] })} ${await gp(context.concept)}`
129
+ return `${modifiers.join(" ")} literally ${await gw(context, { number: context.conceptModifiers[context.conceptModifiers.length - 1] })} ${await gp(context.concept)}`
111
130
  } else {
112
- return `${modifiers.join(" ")} ${await gw(context, { number: context.modifiers[context.modifiers.length - 1] })} ${await gp(context.concept)}`
131
+ return `${modifiers.join(" ")} ${await gw(context, { number: context.conceptModifiers[context.conceptModifiers.length - 1] })} ${await gp(context.concept)}`
113
132
  }
114
133
  }
115
134
  // const chosen = chooseNumber(context, word.singular, word.plural)
116
135
  },
117
136
  ],
118
- semantics: [
119
- {
120
- notes: 'define a modifier',
121
- where: where(),
122
- match: ({context}) => context.marker == 'modifies',
123
- apply: ({config, query, km, context}) => {
124
- let modifiers
125
- if (context.literally) {
126
- literalModifiers = context.modifiers[0]
127
- // modifiers = literalModifiers.value.map(modifier => modifier.value)
128
- modifiers = literalModifiers.value
129
- modifiers = modifiers.slice(0, -1).concat([literalModifiers.marker]).concat(modifiers.slice(-1))
130
- } else {
131
- modifiers = context.modifiers
132
- // modifiers = context.modifiers.map(modifier => modifier.value)
133
- }
134
- // km('concept').api.kindOfConcept({ config, modifiers, object: context.concept.value || context.concept.marker })
135
- km('concept').api.kindOfConcept({ config, modifiers, object: context.concept })
136
- }
137
- },
138
- ],
139
137
  }
140
138
 
141
139
  knowledgeModule({