tpmkms_4wp 9.5.1 → 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 (135) hide show
  1. package/common/animals.instance.json +151 -61
  2. package/common/animals.js +3 -5
  3. package/common/asking.js +116 -106
  4. package/common/avatar.test.json +1001 -860
  5. package/common/can.instance.json +2194 -0
  6. package/common/can.js +251 -0
  7. package/common/can.test.json +51307 -0
  8. package/common/characters.js +5 -5
  9. package/common/colors.instance.json +152 -12
  10. package/common/colors.js +3 -6
  11. package/common/comparable.instance.json +33 -3
  12. package/common/comparable.js +3 -6
  13. package/common/concept.js +25 -27
  14. package/common/concept.test.json +180 -144
  15. package/common/conjunction.js +13 -5
  16. package/common/conjunction.test.json +32 -42
  17. package/common/crew.instance.json +433 -173
  18. package/common/crew.js +4 -7
  19. package/common/crew.test.json +4148 -3324
  20. package/common/currency.js +1 -1
  21. package/common/dateTimeSelectors.instance.json +2 -2
  22. package/common/dateTimeSelectors.js +6 -9
  23. package/common/dateTimeSelectors.test.json +76935 -35739
  24. package/common/dates.instance.json +53 -3
  25. package/common/dates.js +3 -6
  26. package/common/dates.test.json +284 -287
  27. package/common/dialogues.js +43 -122
  28. package/common/dialogues.test.json +1248 -1152
  29. package/common/dimension.instance.json +21493 -561
  30. package/common/dimension.js +150 -55
  31. package/common/dimension.test.json +10979 -4625
  32. package/common/drone.instance.json +24709 -0
  33. package/common/drone.js +662 -0
  34. package/common/drone.test.json +30522 -0
  35. package/common/drone_v1.instance.json +24703 -0
  36. package/common/drone_v1.js +596 -0
  37. package/common/drone_v1.test.json +115538 -0
  38. package/common/edible.instance.json +388 -32
  39. package/common/edible.js +3 -5
  40. package/common/emotions.instance.json +85 -76
  41. package/common/emotions.js +4 -7
  42. package/common/emotions.test.json +242 -174
  43. package/common/english_helpers.js +336 -0
  44. package/common/errors.js +6 -6
  45. package/common/evaluate.js +2 -2
  46. package/common/events.js +8 -8
  47. package/common/fastfood.instance.json +1071 -393
  48. package/common/fastfood.js +14 -16
  49. package/common/fastfood.test.json +6970 -6829
  50. package/common/formulas.instance.json +11 -1
  51. package/common/formulas.js +3 -2
  52. package/common/gdefaults.js +111 -17
  53. package/common/help.js +12 -12
  54. package/common/help.test.json +65 -11
  55. package/common/helpers/concept.js +1 -1
  56. package/common/helpers/conjunction.js +54 -44
  57. package/common/helpers/dateTimeSelectors.js +2 -2
  58. package/common/helpers/dialogues.js +10 -2
  59. package/common/helpers/formulas.js +13 -11
  60. package/common/helpers/menus.js +12 -12
  61. package/common/helpers/meta.js +9 -9
  62. package/common/helpers/properties.js +186 -64
  63. package/common/helpers.js +167 -48
  64. package/common/hierarchy.js +12 -10
  65. package/common/kirk.instance.json +11 -1
  66. package/common/kirk.js +4 -6
  67. package/common/kirk.test.json +600 -424
  68. package/common/latin.instance.json +12 -12
  69. package/common/latin.js +12 -14
  70. package/common/length.instance.json +34660 -3158
  71. package/common/length.js +11 -6
  72. package/common/length.test.json +54357 -2557
  73. package/common/math.instance.json +39 -29
  74. package/common/math.js +49 -47
  75. package/common/menus.instance.json +77 -10
  76. package/common/menus.js +4 -13
  77. package/common/meta.js +80 -65
  78. package/common/nameable.js +36 -22
  79. package/common/nameable.test.json +436 -0
  80. package/common/numbers.js +1 -1
  81. package/common/ordering.instance.json +107 -19
  82. package/common/ordering.js +4 -6
  83. package/common/ordering.test.json +835 -417
  84. package/common/people.instance.json +176 -348
  85. package/common/people.js +9 -9
  86. package/common/people.test.json +4135 -3606
  87. package/common/pipboy.instance.json +187 -17
  88. package/common/pipboy.js +4 -4
  89. package/common/pokemon.instance.json +143 -13
  90. package/common/pokemon.js +4 -6
  91. package/common/pressure.instance.json +3610 -1601
  92. package/common/pressure.js +3 -5
  93. package/common/pressure.test.json +433 -477
  94. package/common/properties.instance.json +16 -17
  95. package/common/properties.js +32 -13
  96. package/common/properties.test.json +9565 -6951
  97. package/common/rates.instance.json +59 -0
  98. package/common/rates.js +95 -0
  99. package/common/rates.test.json +27702 -0
  100. package/common/reminders.instance.json +4 -4
  101. package/common/reminders.js +8 -11
  102. package/common/reminders.test.json +64635 -25787
  103. package/common/reports.instance.json +23 -3
  104. package/common/reports.js +21 -21
  105. package/common/scorekeeper.js +9 -12
  106. package/common/sdefaults.js +22 -2
  107. package/common/spock.instance.json +11 -1
  108. package/common/spock.js +4 -7
  109. package/common/spock.test.json +606 -430
  110. package/common/stgame.js +1 -1
  111. package/common/stm.js +41 -24
  112. package/common/tell.js +1 -1
  113. package/common/temperature.instance.json +3163 -1154
  114. package/common/temperature.js +3 -5
  115. package/common/temperature.test.json +433 -477
  116. package/common/tester.js +3 -3
  117. package/common/time.instance.json +24852 -0
  118. package/common/time.js +138 -141
  119. package/common/time.test.json +31876 -3757
  120. package/common/tokenize.js +5 -2
  121. package/common/ui.instance.json +12 -5
  122. package/common/ui.js +4 -13
  123. package/common/weight.instance.json +10501 -4099
  124. package/common/weight.js +3 -5
  125. package/common/weight.test.json +2601 -2263
  126. package/common/words.instance.json +9 -0
  127. package/common/words.js +50 -0
  128. package/common/words.test.json +2 -0
  129. package/common/wp.instance.json +548 -8
  130. package/common/wp.js +10 -8
  131. package/common/wp.test.json +7385 -6906
  132. package/main.js +6 -2
  133. package/package.json +25 -6
  134. package/common/listener.js +0 -50
  135. package/common/listener.test.json +0 -142
@@ -229,6 +229,16 @@
229
229
  "adjective",
230
230
  false
231
231
  ],
232
+ [
233
+ "stm_current",
234
+ "adjective",
235
+ false
236
+ ],
237
+ [
238
+ "stm_previous",
239
+ "adjective",
240
+ false
241
+ ],
232
242
  [
233
243
  "that",
234
244
  "thisitthat",
@@ -444,7 +454,7 @@
444
454
  ],
445
455
  "ops": [
446
456
  [
447
- "is",
457
+ "be",
448
458
  0
449
459
  ],
450
460
  [
@@ -502,7 +512,7 @@
502
512
  "word": "property1",
503
513
  "range": {
504
514
  "start": 0,
505
- "end": 33
515
+ "end": 23
506
516
  },
507
517
  "dead": true,
508
518
  "types": [
@@ -598,10 +608,7 @@
598
608
  "level": 2,
599
609
  "context_index": 1,
600
610
  "topLevel": true,
601
- "context_id": 2,
602
- "touchedBy": [
603
- "properties#call2"
604
- ]
611
+ "context_id": 2
605
612
  }
606
613
  ],
607
614
  "generated": [
@@ -663,10 +670,6 @@
663
670
  ]
664
671
  ],
665
672
  [
666
- [
667
- "is",
668
- 0
669
- ],
670
673
  [
671
674
  "propertyOf",
672
675
  1
@@ -1019,7 +1022,7 @@
1019
1022
  },
1020
1023
  {
1021
1024
  "marker": [
1022
- "is",
1025
+ "be",
1023
1026
  0
1024
1027
  ],
1025
1028
  "range": {
@@ -1112,7 +1115,7 @@
1112
1115
  "learned_contextual_priorities": [],
1113
1116
  "rtf_associations": [],
1114
1117
  "query": "the property1 of object1 is value1",
1115
- "skipSemantics": false,
1118
+ "skipSemantics": true,
1116
1119
  "key": {
1117
1120
  "query": "the property1 of object1 is value1"
1118
1121
  }
@@ -1167,10 +1170,6 @@
1167
1170
  ]
1168
1171
  ],
1169
1172
  [
1170
- [
1171
- "is",
1172
- 0
1173
- ],
1174
1173
  [
1175
1174
  "propertyOf",
1176
1175
  1
@@ -1523,7 +1522,7 @@
1523
1522
  },
1524
1523
  {
1525
1524
  "marker": [
1526
- "is",
1525
+ "be",
1527
1526
  0
1528
1527
  ],
1529
1528
  "range": {
@@ -1,9 +1,9 @@
1
1
  const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
- const { defaultContextCheck } = require('./helpers')
2
+ const { defaultContextCheck, words } = require('./helpers')
3
3
  const dialogues = require('./dialogues')
4
4
  const meta = require('./meta')
5
5
  const concept = require('./concept')
6
- const properties_instance = require('./properties.instance.json')
6
+ const instance = require('./properties.instance.json')
7
7
  const properties_tests = require('./properties.test.json')
8
8
  const { API } = require('./helpers/properties')
9
9
  const { chooseNumber } = require('./helpers.js')
@@ -75,6 +75,8 @@ const template = {
75
75
  fragments: [
76
76
  "the property1 of object1 is value1",
77
77
  ],
78
+ configs: [
79
+ ],
78
80
  }
79
81
 
80
82
  const api = new API();
@@ -91,6 +93,7 @@ const config = {
91
93
 
92
94
  operators: [
93
95
  "([hierarchyAble|])",
96
+ { pattern: "([propertyRelation|])" }, // , scope: 'development' },
94
97
  "(([property]) <([propertyOf|of] ([object]))>)",
95
98
  "(<whose> ([property]))",
96
99
  // "((modifier) [modifies] (concept))",
@@ -121,6 +124,16 @@ const config = {
121
124
  ['what', 'object'],
122
125
  ],
123
126
  bridges: [
127
+ {
128
+ id: 'propertyRelation',
129
+ // scope: 'development',
130
+ words: words('propertyRelation'),
131
+ evaluator: ({context, api, objects, toList}) => {
132
+ context.evalue = toList(objects.relations)
133
+ context.evalue.isResponse = true
134
+ context.evalue.paraphrase = false
135
+ }
136
+ },
124
137
  {
125
138
  id: 'xfx',
126
139
  isA: ['queryable'],
@@ -345,7 +358,7 @@ const config = {
345
358
  },
346
359
  {
347
360
  where: where(),
348
- match: ({context, hierarchy}) => hierarchy.isA(context.marker, 'canBeDoQuestion') && context.paraphrase && !context.query,
361
+ match: ({context, hierarchy}) => hierarchy.isA(context.marker, 'canBeDoQuestion') && context.paraphrase && !context.query && !context.interpolate,
349
362
  apply: async ({context, g}) => {
350
363
  return `${await g(context.object)} ${context.word} ${await g(context.property)}`
351
364
  }
@@ -354,7 +367,7 @@ const config = {
354
367
  notes: 'the property of object',
355
368
  where: where(),
356
369
  // match: ({context}) => context.paraphrase && context.modifiers && context.object,
357
- match: ({context}) => context.paraphrase && !context.possession && context.object,
370
+ match: ({context}) => context.paraphrase && !context.possession && context.object && !context.interpolate,
358
371
  apply: async ({context, g, gs}) => {
359
372
  const base = { ...context }
360
373
  base.object = undefined;
@@ -387,7 +400,7 @@ const config = {
387
400
  notes: "object's property",
388
401
  where: where(),
389
402
  // match: ({context}) => context.paraphrase && !context.modifiers && context.object,
390
- match: ({context}) => !context.modifiers && context.object,
403
+ match: ({context}) => !context.modifiers && context.object && !context.interpolate,
391
404
  apply: async ({context, g, gs}) => {
392
405
  if (context.objects) {
393
406
  const objects = [ ...context.objects ]
@@ -559,7 +572,7 @@ const config = {
559
572
  } catch (e) {
560
573
  log(`Error processing set property of an object: ${e}`)
561
574
  const config = km('properties')
562
- const fragment = fragments("the property1 of object1 is value1")
575
+ const fragment = await fragments("the property1 of object1 is value1")
563
576
  const value = await api.getProperty(objectId, propertyId)
564
577
  if (value.value == context.same.value) {
565
578
  context.evalue = [
@@ -612,11 +625,14 @@ const config = {
612
625
  apply: async ({context, api, kms, objects, g, s, log}) => {
613
626
  const toDo = [ ...context.objects ]
614
627
 
615
- const toValue = async (objectContext) => {
628
+ async function toValue(objectContext) {
616
629
  if (!objectContext.value) {
617
630
  return objectContext;
618
631
  }
619
- const objectValue = kms.stm.api.getVariable(objectContext.value);
632
+ let objectValue = kms.stm.api.getVariable(objectContext);
633
+ if (!objectValue) {
634
+ objectValue = objectContext.value
635
+ }
620
636
  if (!await api.knownObject(objectValue)) {
621
637
  context.verbatim = `There is no object named "${await g({...objectContext, paraphrase: true})}"`
622
638
  return
@@ -660,7 +676,7 @@ const config = {
660
676
  ]
661
677
  };
662
678
 
663
- const initializer = ({objects, config, isModule}) => {
679
+ function initializer({objects, config, isModule}) {
664
680
  // debugger
665
681
  config.addArgs(({config, api, isA}) => ({
666
682
  makeObject: api('properties').makeObject,
@@ -686,6 +702,11 @@ knowledgeModule( {
686
702
  defaultContextCheck({ marker: 'objectPrefix', exported: true, extra: ['object', 'objects'] }),
687
703
  defaultContextCheck()
688
704
  ],
705
+ /*
706
+ objects: [
707
+ 'relations'
708
+ ]
709
+ */
689
710
  },
690
711
  include: {
691
712
  words: true,
@@ -693,8 +714,6 @@ knowledgeModule( {
693
714
  bridges: true,
694
715
  }
695
716
  },
696
- template: {
697
- template,
698
- instance: properties_instance,
699
- },
717
+ instance,
718
+ template,
700
719
  })