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
@@ -719,6 +719,16 @@
719
719
  "adjective",
720
720
  false
721
721
  ],
722
+ [
723
+ "stm_current",
724
+ "adjective",
725
+ false
726
+ ],
727
+ [
728
+ "stm_previous",
729
+ "adjective",
730
+ false
731
+ ],
722
732
  [
723
733
  "that",
724
734
  "thisitthat",
@@ -878,7 +888,7 @@
878
888
  "end": 29
879
889
  },
880
890
  "dead": true,
881
- "modifiers": [
891
+ "conceptModifiers": [
882
892
  {
883
893
  "value": "mathematical",
884
894
  "unknown": true,
package/common/math.js CHANGED
@@ -120,7 +120,8 @@ knowledgeModule( {
120
120
 
121
121
  module,
122
122
  description: 'talking about math',
123
- template: { template, instance },
123
+ instance,
124
+ template,
124
125
  test: {
125
126
  name: './math.test.json',
126
127
  contents: tests,
@@ -43,7 +43,7 @@
43
43
  "semantics": [
44
44
  {
45
45
  "match": "({context, isA}) => isA(context, 'showable_menus')",
46
- "apply": "async ({context, insert, s, fragments}) => {\n const value = context\n const fragment = fragments(\"show showable\")\n const mappings = [{\n where: where(),\n match: ({context}) => context.value == 'showable_menus',\n apply: ({context}) => Object.assign(context, value),\n }]\n const instantiation = await fragment.instantiate(mappings)\n await s(instantiation)\n }"
46
+ "apply": "async ({context, insert, s, fragments}) => {\n const instantiation = await fragments(\"show showable\", { 'showable_menus': context })\n await s(instantiation)\n }"
47
47
  }
48
48
  ]
49
49
  },
@@ -807,6 +807,16 @@
807
807
  "adjective",
808
808
  false
809
809
  ],
810
+ [
811
+ "stm_current",
812
+ "adjective",
813
+ false
814
+ ],
815
+ [
816
+ "stm_previous",
817
+ "adjective",
818
+ false
819
+ ],
810
820
  [
811
821
  "stop",
812
822
  "verb",
@@ -1861,6 +1871,16 @@
1861
1871
  "adjective",
1862
1872
  false
1863
1873
  ],
1874
+ [
1875
+ "stm_current",
1876
+ "adjective",
1877
+ false
1878
+ ],
1879
+ [
1880
+ "stm_previous",
1881
+ "adjective",
1882
+ false
1883
+ ],
1864
1884
  [
1865
1885
  "stop",
1866
1886
  "verb",
@@ -3139,6 +3159,16 @@
3139
3159
  "adjective",
3140
3160
  false
3141
3161
  ],
3162
+ [
3163
+ "stm_current",
3164
+ "adjective",
3165
+ false
3166
+ ],
3167
+ [
3168
+ "stm_previous",
3169
+ "adjective",
3170
+ false
3171
+ ],
3142
3172
  [
3143
3173
  "stop",
3144
3174
  "verb",
@@ -4457,6 +4487,16 @@
4457
4487
  "adjective",
4458
4488
  false
4459
4489
  ],
4490
+ [
4491
+ "stm_current",
4492
+ "adjective",
4493
+ false
4494
+ ],
4495
+ [
4496
+ "stm_previous",
4497
+ "adjective",
4498
+ false
4499
+ ],
4460
4500
  [
4461
4501
  "stop",
4462
4502
  "verb",
@@ -4651,7 +4691,7 @@
4651
4691
  "end": 17
4652
4692
  },
4653
4693
  "dead": true,
4654
- "modifiers": [
4694
+ "conceptModifiers": [
4655
4695
  {
4656
4696
  "value": "menu_menus",
4657
4697
  "number": "one",
@@ -5746,6 +5786,16 @@
5746
5786
  "adjective",
5747
5787
  false
5748
5788
  ],
5789
+ [
5790
+ "stm_current",
5791
+ "adjective",
5792
+ false
5793
+ ],
5794
+ [
5795
+ "stm_previous",
5796
+ "adjective",
5797
+ false
5798
+ ],
5749
5799
  [
5750
5800
  "stop",
5751
5801
  "verb",
@@ -7488,6 +7538,16 @@
7488
7538
  "adjective",
7489
7539
  false
7490
7540
  ],
7541
+ [
7542
+ "stm_current",
7543
+ "adjective",
7544
+ false
7545
+ ],
7546
+ [
7547
+ "stm_previous",
7548
+ "adjective",
7549
+ false
7550
+ ],
7491
7551
  [
7492
7552
  "stop",
7493
7553
  "verb",
@@ -8639,6 +8699,16 @@
8639
8699
  "adjective",
8640
8700
  false
8641
8701
  ],
8702
+ [
8703
+ "stm_current",
8704
+ "adjective",
8705
+ false
8706
+ ],
8707
+ [
8708
+ "stm_previous",
8709
+ "adjective",
8710
+ false
8711
+ ],
8642
8712
  [
8643
8713
  "stop",
8644
8714
  "verb",
@@ -8839,10 +8909,7 @@
8839
8909
  "level": 1,
8840
8910
  "context_index": 1,
8841
8911
  "topLevel": true,
8842
- "context_id": 2,
8843
- "touchedBy": [
8844
- "menus#call2"
8845
- ]
8912
+ "context_id": 2
8846
8913
  }
8847
8914
  ],
8848
8915
  "generated": [
@@ -8943,7 +9010,7 @@
8943
9010
  "learned_contextual_priorities": [],
8944
9011
  "rtf_associations": [],
8945
9012
  "query": "show showable",
8946
- "skipSemantics": false,
9013
+ "skipSemantics": true,
8947
9014
  "key": {
8948
9015
  "query": "show showable"
8949
9016
  }
package/common/menus.js CHANGED
@@ -156,14 +156,7 @@ const template = {
156
156
  where: where(),
157
157
  match: ({context, isA}) => isA(context, 'showable_menus'),
158
158
  apply: async ({context, insert, s, fragments}) => {
159
- const value = context
160
- const fragment = fragments("show showable")
161
- const mappings = [{
162
- where: where(),
163
- match: ({context}) => context.value == 'showable_menus',
164
- apply: ({context}) => Object.assign(context, value),
165
- }]
166
- const instantiation = await fragment.instantiate(mappings)
159
+ const instantiation = await fragments("show showable", { 'showable_menus': context })
167
160
  await s(instantiation)
168
161
  }
169
162
  },
@@ -256,8 +249,6 @@ knowledgeModule({
256
249
  ],
257
250
  },
258
251
  },
259
- template: {
260
- template,
261
- instance,
262
- }
252
+ instance,
253
+ template,
263
254
  })
package/common/meta.js CHANGED
@@ -5,7 +5,7 @@ const gdefaults = require('./gdefaults.js')
5
5
  ensureTestFile(module, 'meta', 'test')
6
6
  ensureTestFile(module, 'meta', 'instance')
7
7
  const meta_tests = require('./meta.test.json')
8
- const meta_instance = require('./meta.instance.json')
8
+ const instance = require('./meta.instance.json')
9
9
  const { hashIndexesGet, hashIndexesSet, translationMapping, translationMappings } = require('./helpers/meta.js')
10
10
  const { zip, words } = require('./helpers.js')
11
11
 
@@ -296,6 +296,7 @@ const config = {
296
296
  }
297
297
  if (context.to.value) {
298
298
  kms.stm.api.setVariable(context.from.value, context.to.value)
299
+ // config.addWord(context.from.word, context.to)
299
300
  } else {
300
301
  await kms.dialogues.api.makeObject({ context: context.from, types: context.to.types || [], config });
301
302
  kms.stm.api.setVariable(context.from.value, context.to)
@@ -412,8 +413,6 @@ knowledgeModule({
412
413
  context: [defaultContextCheck()],
413
414
  },
414
415
  },
415
- template: {
416
- template,
417
- instance: meta_instance,
418
- },
416
+ instance,
417
+ template,
419
418
  })
@@ -1,5 +1,5 @@
1
1
  const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
- const { defaultContextCheck } = require('./helpers')
2
+ const { defaultContextCheck, defaultContextCheckProperties } = require('./helpers')
3
3
  const helpers = require('./helpers')
4
4
  const stm = require('./stm')
5
5
  const nameable_tests = require('./nameable.test.json')
@@ -14,13 +14,10 @@ class API {
14
14
 
15
15
  // report is a context
16
16
  setName(context, name) {
17
- if (!context.stm) {
18
- context.stm = {}
19
- }
20
- if (!context.stm.names) {
21
- context.stm.names = []
22
- }
17
+ context.stm ??= {}
18
+ context.stm.names ??= []
23
19
  context.stm.names.push(name)
20
+ this.args.config.addWord(name, { id: context.marker, initial: `{ value: "${name}", pullFromContext: true, nameable_named: true }` })
24
21
  }
25
22
 
26
23
  get(type, name) {
@@ -70,8 +67,18 @@ class API {
70
67
  }
71
68
  }
72
69
 
73
- const api = new API()
74
-
70
+ function initializer({config}) {
71
+ config.addArgs(({kms, mentioned}) => {
72
+ return {
73
+ mentioned: (args) => {
74
+ mentioned(args)
75
+ if (args.name) {
76
+ kms.nameable.api.setName(args.context, args.name)
77
+ }
78
+ },
79
+ }
80
+ })
81
+ }
75
82
  const config = {
76
83
  name: 'nameable',
77
84
  operators: [
@@ -107,19 +114,25 @@ const config = {
107
114
  id: 'call',
108
115
  isA: ['verb'],
109
116
  bridge: "{ ...next(operator), nameable: after[0], name: after[1:][0] }",
110
- // bridge: "{ ...next(operator), nameable: after[0], name: after[1] }",
111
- // generatorp: async ({context, g}) => `call ${await g(context.nameable)} ${await g(context.name)}`,
112
117
  generatorp: async ({context, g, gs}) => `call ${await g(context.nameable)} ${await gs(context.name)}`,
113
- semantic: async ({config, context, api, e}) => {
118
+ semantic: async ({config, context, api, e, verbatim, g}) => {
114
119
  // TODO find report being referred to
115
120
  const nameable = (await e(context.nameable)).evalue
121
+ if (!nameable) {
122
+ verbatim(`${await g(context.nameable)} is not known`)
123
+ return
124
+ }
116
125
  const name = context.name.map((n) => n.text).join(' ')
117
126
  // const name = context.name.text
118
- config.addWord(name, { id: nameable.marker, initial: `{ value: "${name}", pullFromContext: true, nameable_named: true }` })
119
127
  api.setName(nameable, name)
120
- }
128
+ },
129
+ check: defaultContextCheckProperties(['nameable', 'name']),
130
+ },
131
+ {
132
+ id: 'nameable',
133
+ words: helpers.words('nameable'),
134
+ children: ['thisitthat'],
121
135
  },
122
- { id: 'nameable', words: helpers.words('nameable')},
123
136
  ]
124
137
  }
125
138
 
@@ -127,6 +140,7 @@ knowledgeModule( {
127
140
  config,
128
141
  api: () => new API(),
129
142
  includes: [stm],
143
+ initializer,
130
144
 
131
145
  module,
132
146
  description: 'namable objects',