tpmkms_4wp 9.5.1-beta.9 → 9.6.0-beta.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 (114) hide show
  1. package/common/animals.instance.json +130 -0
  2. package/common/animals.js +3 -5
  3. package/common/asking.js +12 -4
  4. package/common/avatar.test.json +1001 -860
  5. package/common/can.instance.json +2182 -5
  6. package/common/can.js +102 -39
  7. package/common/can.test.json +51307 -0
  8. package/common/colors.instance.json +142 -30
  9. package/common/colors.js +3 -6
  10. package/common/comparable.instance.json +31 -1
  11. package/common/comparable.js +3 -6
  12. package/common/concept.js +25 -27
  13. package/common/concept.test.json +142 -120
  14. package/common/conjunction.test.json +32 -42
  15. package/common/crew.instance.json +400 -126
  16. package/common/crew.js +3 -6
  17. package/common/dateTimeSelectors.instance.json +2 -2
  18. package/common/dateTimeSelectors.js +6 -9
  19. package/common/dateTimeSelectors.test.json +76935 -35739
  20. package/common/dates.instance.json +50 -84
  21. package/common/dates.js +3 -6
  22. package/common/dates.test.json +284 -287
  23. package/common/dialogues.js +33 -115
  24. package/common/dialogues.test.json +1248 -1152
  25. package/common/dimension.instance.json +21498 -566
  26. package/common/dimension.js +147 -52
  27. package/common/dimension.test.json +10979 -4625
  28. package/common/drone.instance.json +24709 -0
  29. package/common/drone.js +662 -0
  30. package/common/drone.test.json +30522 -0
  31. package/common/drone_v1.instance.json +24703 -0
  32. package/common/drone_v1.js +596 -0
  33. package/common/drone_v1.test.json +115538 -0
  34. package/common/edible.instance.json +365 -65
  35. package/common/edible.js +3 -5
  36. package/common/emotions.instance.json +57 -70
  37. package/common/emotions.js +3 -6
  38. package/common/errors.js +3 -3
  39. package/common/fastfood.instance.json +1270 -244
  40. package/common/fastfood.js +10 -12
  41. package/common/fastfood.test.json +6970 -6829
  42. package/common/formulas.instance.json +10 -0
  43. package/common/formulas.js +2 -1
  44. package/common/gdefaults.js +58 -13
  45. package/common/help.js +9 -9
  46. package/common/help.test.json +65 -11
  47. package/common/helpers/dialogues.js +9 -1
  48. package/common/helpers/properties.js +37 -18
  49. package/common/helpers.js +32 -2
  50. package/common/hierarchy.js +10 -8
  51. package/common/kirk.instance.json +10 -0
  52. package/common/kirk.js +4 -6
  53. package/common/kirk.test.json +600 -424
  54. package/common/latin.instance.json +10 -10
  55. package/common/latin.js +8 -10
  56. package/common/length.instance.json +34659 -3157
  57. package/common/length.js +11 -6
  58. package/common/length.test.json +54357 -2557
  59. package/common/math.instance.json +11 -1
  60. package/common/math.js +2 -1
  61. package/common/menus.instance.json +74 -7
  62. package/common/menus.js +3 -12
  63. package/common/meta.js +4 -5
  64. package/common/nameable.js +29 -15
  65. package/common/nameable.test.json +436 -0
  66. package/common/numbers.js +1 -1
  67. package/common/ordering.instance.json +24 -2
  68. package/common/ordering.js +3 -5
  69. package/common/ordering.test.json +104 -174
  70. package/common/people.instance.json +140 -315
  71. package/common/people.js +3 -5
  72. package/common/pipboy.instance.json +171 -57
  73. package/common/pipboy.js +2 -1
  74. package/common/pokemon.instance.json +135 -5
  75. package/common/pokemon.js +3 -5
  76. package/common/pressure.instance.json +3990 -1981
  77. package/common/pressure.js +3 -5
  78. package/common/pressure.test.json +433 -477
  79. package/common/properties.instance.json +15 -16
  80. package/common/properties.js +10 -9
  81. package/common/properties.test.json +9565 -6951
  82. package/common/rates.instance.json +59 -0
  83. package/common/rates.js +95 -0
  84. package/common/rates.test.json +27702 -0
  85. package/common/reminders.js +5 -8
  86. package/common/reminders.test.json +64635 -25787
  87. package/common/reports.instance.json +22 -2
  88. package/common/reports.js +3 -5
  89. package/common/scorekeeper.js +3 -6
  90. package/common/spock.instance.json +10 -0
  91. package/common/spock.js +4 -7
  92. package/common/spock.test.json +606 -430
  93. package/common/stm.js +37 -20
  94. package/common/temperature.instance.json +3162 -1153
  95. package/common/temperature.js +3 -5
  96. package/common/temperature.test.json +433 -477
  97. package/common/time.instance.json +24852 -0
  98. package/common/time.js +136 -139
  99. package/common/time.test.json +31876 -3757
  100. package/common/ui.instance.json +12 -5
  101. package/common/ui.js +4 -13
  102. package/common/weight.instance.json +10500 -4098
  103. package/common/weight.js +3 -5
  104. package/common/weight.test.json +2601 -2263
  105. package/common/words.instance.json +9 -0
  106. package/common/words.js +50 -0
  107. package/common/words.test.json +2 -0
  108. package/common/wp.instance.json +470 -58
  109. package/common/wp.js +6 -4
  110. package/common/wp.test.json +7385 -6906
  111. package/main.js +6 -2
  112. package/package.json +21 -6
  113. package/common/listener.js +0 -50
  114. package/common/listener.test.json +0 -142
@@ -359,6 +359,16 @@
359
359
  "adjective",
360
360
  false
361
361
  ],
362
+ [
363
+ "stm_current",
364
+ "adjective",
365
+ false
366
+ ],
367
+ [
368
+ "stm_previous",
369
+ "adjective",
370
+ false
371
+ ],
362
372
  [
363
373
  "that",
364
374
  "thisitthat",
@@ -848,6 +858,16 @@
848
858
  "adjective",
849
859
  false
850
860
  ],
861
+ [
862
+ "stm_current",
863
+ "adjective",
864
+ false
865
+ ],
866
+ [
867
+ "stm_previous",
868
+ "adjective",
869
+ false
870
+ ],
851
871
  [
852
872
  "that",
853
873
  "thisitthat",
@@ -1843,6 +1863,16 @@
1843
1863
  "adjective",
1844
1864
  false
1845
1865
  ],
1866
+ [
1867
+ "stm_current",
1868
+ "adjective",
1869
+ false
1870
+ ],
1871
+ [
1872
+ "stm_previous",
1873
+ "adjective",
1874
+ false
1875
+ ],
1846
1876
  [
1847
1877
  "that",
1848
1878
  "thisitthat",
@@ -3586,20 +3616,6 @@
3586
3616
  0
3587
3617
  ]
3588
3618
  ],
3589
- [
3590
- [
3591
- "is",
3592
- 0
3593
- ],
3594
- [
3595
- "list",
3596
- 1
3597
- ],
3598
- [
3599
- "unknown",
3600
- 0
3601
- ]
3602
- ],
3603
3619
  [
3604
3620
  [
3605
3621
  "is",
@@ -8901,6 +8917,16 @@
8901
8917
  "adjective",
8902
8918
  false
8903
8919
  ],
8920
+ [
8921
+ "stm_current",
8922
+ "adjective",
8923
+ false
8924
+ ],
8925
+ [
8926
+ "stm_previous",
8927
+ "adjective",
8928
+ false
8929
+ ],
8904
8930
  [
8905
8931
  "that",
8906
8932
  "thisitthat",
@@ -10243,6 +10269,16 @@
10243
10269
  "adjective",
10244
10270
  false
10245
10271
  ],
10272
+ [
10273
+ "stm_current",
10274
+ "adjective",
10275
+ false
10276
+ ],
10277
+ [
10278
+ "stm_previous",
10279
+ "adjective",
10280
+ false
10281
+ ],
10246
10282
  [
10247
10283
  "that",
10248
10284
  "thisitthat",
@@ -11934,6 +11970,16 @@
11934
11970
  "adjective",
11935
11971
  false
11936
11972
  ],
11973
+ [
11974
+ "stm_current",
11975
+ "adjective",
11976
+ false
11977
+ ],
11978
+ [
11979
+ "stm_previous",
11980
+ "adjective",
11981
+ false
11982
+ ],
11937
11983
  [
11938
11984
  "that",
11939
11985
  "thisitthat",
@@ -14691,6 +14737,16 @@
14691
14737
  "adjective",
14692
14738
  false
14693
14739
  ],
14740
+ [
14741
+ "stm_current",
14742
+ "adjective",
14743
+ false
14744
+ ],
14745
+ [
14746
+ "stm_previous",
14747
+ "adjective",
14748
+ false
14749
+ ],
14694
14750
  [
14695
14751
  "that",
14696
14752
  "thisitthat",
@@ -17608,6 +17664,16 @@
17608
17664
  "adjective",
17609
17665
  false
17610
17666
  ],
17667
+ [
17668
+ "stm_current",
17669
+ "adjective",
17670
+ false
17671
+ ],
17672
+ [
17673
+ "stm_previous",
17674
+ "adjective",
17675
+ false
17676
+ ],
17611
17677
  [
17612
17678
  "teal_colors",
17613
17679
  "green_colors",
@@ -21316,6 +21382,16 @@
21316
21382
  "adjective",
21317
21383
  false
21318
21384
  ],
21385
+ [
21386
+ "stm_current",
21387
+ "adjective",
21388
+ false
21389
+ ],
21390
+ [
21391
+ "stm_previous",
21392
+ "adjective",
21393
+ false
21394
+ ],
21319
21395
  [
21320
21396
  "teal_colors",
21321
21397
  "green_colors",
@@ -24058,6 +24134,16 @@
24058
24134
  "adjective",
24059
24135
  false
24060
24136
  ],
24137
+ [
24138
+ "stm_current",
24139
+ "adjective",
24140
+ false
24141
+ ],
24142
+ [
24143
+ "stm_previous",
24144
+ "adjective",
24145
+ false
24146
+ ],
24061
24147
  [
24062
24148
  "tan_colors",
24063
24149
  "brown_colors",
@@ -27495,6 +27581,16 @@
27495
27581
  "adjective",
27496
27582
  false
27497
27583
  ],
27584
+ [
27585
+ "stm_current",
27586
+ "adjective",
27587
+ false
27588
+ ],
27589
+ [
27590
+ "stm_previous",
27591
+ "adjective",
27592
+ false
27593
+ ],
27498
27594
  [
27499
27595
  "tan_colors",
27500
27596
  "brown_colors",
@@ -30066,6 +30162,16 @@
30066
30162
  "adjective",
30067
30163
  false
30068
30164
  ],
30165
+ [
30166
+ "stm_current",
30167
+ "adjective",
30168
+ false
30169
+ ],
30170
+ [
30171
+ "stm_previous",
30172
+ "adjective",
30173
+ false
30174
+ ],
30069
30175
  [
30070
30176
  "tan_colors",
30071
30177
  "brown_colors",
@@ -30465,7 +30571,7 @@
30465
30571
  "end": 25
30466
30572
  },
30467
30573
  "dead": true,
30468
- "modifiers": [
30574
+ "conceptModifiers": [
30469
30575
  {
30470
30576
  "value": "brightness_colors",
30471
30577
  "number": "one",
@@ -32275,6 +32381,16 @@
32275
32381
  "adjective",
32276
32382
  false
32277
32383
  ],
32384
+ [
32385
+ "stm_current",
32386
+ "adjective",
32387
+ false
32388
+ ],
32389
+ [
32390
+ "stm_previous",
32391
+ "adjective",
32392
+ false
32393
+ ],
32278
32394
  [
32279
32395
  "tan_colors",
32280
32396
  "brown_colors",
@@ -32674,7 +32790,7 @@
32674
32790
  "end": 17
32675
32791
  },
32676
32792
  "dead": true,
32677
- "modifiers": [
32793
+ "conceptModifiers": [
32678
32794
  {
32679
32795
  "value": "hex",
32680
32796
  "unknown": true,
@@ -34691,6 +34807,16 @@
34691
34807
  "adjective",
34692
34808
  false
34693
34809
  ],
34810
+ [
34811
+ "stm_current",
34812
+ "adjective",
34813
+ false
34814
+ ],
34815
+ [
34816
+ "stm_previous",
34817
+ "adjective",
34818
+ false
34819
+ ],
34694
34820
  [
34695
34821
  "tan_colors",
34696
34822
  "brown_colors",
@@ -35827,20 +35953,6 @@
35827
35953
  0
35828
35954
  ]
35829
35955
  ],
35830
- [
35831
- [
35832
- "is",
35833
- 0
35834
- ],
35835
- [
35836
- "list",
35837
- 1
35838
- ],
35839
- [
35840
- "unknown",
35841
- 0
35842
- ]
35843
- ],
35844
35956
  [
35845
35957
  [
35846
35958
  "is",
package/common/colors.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const colors_tests = require('./colors.test.json')
4
- const colors_instance = require('./colors.instance.json')
4
+ const instance = require('./colors.instance.json')
5
5
  const hierarchy = require('./hierarchy')
6
6
 
7
7
  const template = {
@@ -59,9 +59,6 @@ knowledgeModule( {
59
59
  context: [defaultContextCheck()],
60
60
  }
61
61
  },
62
- template: {
63
- template,
64
- instance: colors_instance,
65
- },
66
-
62
+ instance,
63
+ template,
67
64
  })
@@ -223,6 +223,16 @@
223
223
  "adjective",
224
224
  false
225
225
  ],
226
+ [
227
+ "stm_current",
228
+ "adjective",
229
+ false
230
+ ],
231
+ [
232
+ "stm_previous",
233
+ "adjective",
234
+ false
235
+ ],
226
236
  [
227
237
  "that",
228
238
  "thisitthat",
@@ -352,7 +362,7 @@
352
362
  "end": 21
353
363
  },
354
364
  "dead": true,
355
- "modifiers": [
365
+ "conceptModifiers": [
356
366
  {
357
367
  "value": "sort",
358
368
  "unknown": true,
@@ -773,6 +783,16 @@
773
783
  "adjective",
774
784
  false
775
785
  ],
786
+ [
787
+ "stm_current",
788
+ "adjective",
789
+ false
790
+ ],
791
+ [
792
+ "stm_previous",
793
+ "adjective",
794
+ false
795
+ ],
776
796
  [
777
797
  "that",
778
798
  "thisitthat",
@@ -1602,6 +1622,16 @@
1602
1622
  "adjective",
1603
1623
  false
1604
1624
  ],
1625
+ [
1626
+ "stm_current",
1627
+ "adjective",
1628
+ false
1629
+ ],
1630
+ [
1631
+ "stm_previous",
1632
+ "adjective",
1633
+ false
1634
+ ],
1605
1635
  [
1606
1636
  "that",
1607
1637
  "thisitthat",
@@ -4,7 +4,7 @@ const dialogues = require("./dialogues")
4
4
  const concept = require("./concept")
5
5
  const numbers = require("./numbers")
6
6
  const comparable_tests = require('./comparable.test.json')
7
- const comparable_instance = require('./comparable.instance.json')
7
+ const instance = require('./comparable.instance.json')
8
8
 
9
9
 
10
10
  const config = {
@@ -70,11 +70,8 @@ const template = {
70
70
  knowledgeModule({
71
71
  config,
72
72
  includes: [dialogues, numbers, concept],
73
- template: {
74
- template,
75
- instance: comparable_instance
76
- },
77
-
73
+ instance,
74
+ template,
78
75
  module,
79
76
  description: 'Comparable things',
80
77
  test: {
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({