tpmkms_4wp 9.5.1-beta.9 → 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 (87) hide show
  1. package/common/asking.js +12 -4
  2. package/common/avatar.test.json +1001 -860
  3. package/common/can.instance.json +2162 -5
  4. package/common/can.js +101 -35
  5. package/common/can.test.json +51307 -0
  6. package/common/colors.instance.json +2 -30
  7. package/common/comparable.instance.json +1 -1
  8. package/common/concept.js +25 -27
  9. package/common/concept.test.json +142 -120
  10. package/common/conjunction.test.json +32 -42
  11. package/common/crew.instance.json +163 -113
  12. package/common/dateTimeSelectors.instance.json +2 -2
  13. package/common/dateTimeSelectors.js +3 -3
  14. package/common/dateTimeSelectors.test.json +76935 -35739
  15. package/common/dates.instance.json +0 -84
  16. package/common/dates.test.json +284 -287
  17. package/common/dialogues.js +31 -112
  18. package/common/dialogues.test.json +1171 -996
  19. package/common/dimension.instance.json +21374 -562
  20. package/common/dimension.js +145 -51
  21. package/common/dimension.test.json +8753 -3495
  22. package/common/drone.instance.json +23712 -0
  23. package/common/drone.js +448 -0
  24. package/common/drone.test.json +66665 -0
  25. package/common/edible.instance.json +9 -65
  26. package/common/emotions.instance.json +47 -70
  27. package/common/errors.js +3 -3
  28. package/common/fastfood.instance.json +758 -266
  29. package/common/fastfood.js +7 -7
  30. package/common/fastfood.test.json +6970 -6829
  31. package/common/gdefaults.js +58 -13
  32. package/common/help.js +9 -9
  33. package/common/help.test.json +65 -11
  34. package/common/helpers/dialogues.js +6 -1
  35. package/common/helpers/properties.js +36 -16
  36. package/common/helpers.js +32 -2
  37. package/common/hierarchy.js +3 -1
  38. package/common/kirk.test.json +600 -424
  39. package/common/latin.instance.json +10 -10
  40. package/common/latin.js +5 -5
  41. package/common/length.instance.json +27611 -2889
  42. package/common/length.js +6 -1
  43. package/common/length.test.json +45315 -3925
  44. package/common/math.instance.json +1 -1
  45. package/common/menus.instance.json +4 -7
  46. package/common/menus.js +1 -8
  47. package/common/meta.js +1 -0
  48. package/common/nameable.js +13 -6
  49. package/common/nameable.test.json +436 -0
  50. package/common/numbers.js +1 -1
  51. package/common/ordering.instance.json +4 -2
  52. package/common/ordering.test.json +104 -174
  53. package/common/people.instance.json +60 -315
  54. package/common/pipboy.instance.json +1 -57
  55. package/common/pokemon.instance.json +5 -5
  56. package/common/pressure.instance.json +3959 -1990
  57. package/common/pressure.test.json +433 -477
  58. package/common/properties.instance.json +5 -16
  59. package/common/properties.js +3 -3
  60. package/common/properties.test.json +9565 -6951
  61. package/common/rates.instance.json +59 -0
  62. package/common/rates.js +97 -0
  63. package/common/rates.test.json +27702 -0
  64. package/common/reminders.js +2 -2
  65. package/common/reminders.test.json +64635 -25787
  66. package/common/reports.instance.json +2 -2
  67. package/common/spock.test.json +606 -430
  68. package/common/stm.js +13 -2
  69. package/common/temperature.instance.json +3658 -1689
  70. package/common/temperature.test.json +433 -477
  71. package/common/time.instance.json +24762 -0
  72. package/common/time.js +135 -139
  73. package/common/time.test.json +31876 -3757
  74. package/common/ui.instance.json +2 -5
  75. package/common/ui.js +1 -8
  76. package/common/weight.instance.json +10359 -4077
  77. package/common/weight.test.json +2601 -2263
  78. package/common/words.instance.json +9 -0
  79. package/common/words.js +53 -0
  80. package/common/words.test.json +2 -0
  81. package/common/wp.instance.json +330 -58
  82. package/common/wp.js +4 -0
  83. package/common/wp.test.json +7385 -6906
  84. package/main.js +4 -2
  85. package/package.json +16 -5
  86. package/common/listener.js +0 -50
  87. package/common/listener.test.json +0 -142
@@ -878,7 +878,7 @@
878
878
  "end": 29
879
879
  },
880
880
  "dead": true,
881
- "modifiers": [
881
+ "conceptModifiers": [
882
882
  {
883
883
  "value": "mathematical",
884
884
  "unknown": true,
@@ -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
  },
@@ -4651,7 +4651,7 @@
4651
4651
  "end": 17
4652
4652
  },
4653
4653
  "dead": true,
4654
- "modifiers": [
4654
+ "conceptModifiers": [
4655
4655
  {
4656
4656
  "value": "menu_menus",
4657
4657
  "number": "one",
@@ -8839,10 +8839,7 @@
8839
8839
  "level": 1,
8840
8840
  "context_index": 1,
8841
8841
  "topLevel": true,
8842
- "context_id": 2,
8843
- "touchedBy": [
8844
- "menus#call2"
8845
- ]
8842
+ "context_id": 2
8846
8843
  }
8847
8844
  ],
8848
8845
  "generated": [
@@ -8943,7 +8940,7 @@
8943
8940
  "learned_contextual_priorities": [],
8944
8941
  "rtf_associations": [],
8945
8942
  "query": "show showable",
8946
- "skipSemantics": false,
8943
+ "skipSemantics": true,
8947
8944
  "key": {
8948
8945
  "query": "show showable"
8949
8946
  }
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
  },
package/common/meta.js CHANGED
@@ -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)
@@ -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')
@@ -107,19 +107,26 @@ const config = {
107
107
  id: 'call',
108
108
  isA: ['verb'],
109
109
  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
110
  generatorp: async ({context, g, gs}) => `call ${await g(context.nameable)} ${await gs(context.name)}`,
113
- semantic: async ({config, context, api, e}) => {
111
+ semantic: async ({config, context, api, e, verbatim, g}) => {
114
112
  // TODO find report being referred to
115
113
  const nameable = (await e(context.nameable)).evalue
114
+ if (!nameable) {
115
+ verbatim(`${await g(context.nameable)} is not known`)
116
+ return
117
+ }
116
118
  const name = context.name.map((n) => n.text).join(' ')
117
119
  // const name = context.name.text
118
120
  config.addWord(name, { id: nameable.marker, initial: `{ value: "${name}", pullFromContext: true, nameable_named: true }` })
119
121
  api.setName(nameable, name)
120
- }
122
+ },
123
+ check: defaultContextCheckProperties(['nameable', 'name']),
124
+ },
125
+ {
126
+ id: 'nameable',
127
+ words: helpers.words('nameable'),
128
+ children: ['thisitthat'],
121
129
  },
122
- { id: 'nameable', words: helpers.words('nameable')},
123
130
  ]
124
131
  }
125
132
 
@@ -6862,5 +6862,441 @@
6862
6862
  ]
6863
6863
  }
6864
6864
  ]
6865
+ },
6866
+ {
6867
+ "associations": [
6868
+ [
6869
+ [
6870
+ "call",
6871
+ 0
6872
+ ],
6873
+ [
6874
+ "nameable",
6875
+ 0
6876
+ ],
6877
+ [
6878
+ "unknown",
6879
+ 0
6880
+ ]
6881
+ ]
6882
+ ],
6883
+ "config": {
6884
+ "words": {
6885
+ "hierarchy": [
6886
+ ],
6887
+ "literals": {
6888
+ "\"": [
6889
+ {
6890
+ "id": "doubleQuote",
6891
+ "initial": "{\"word\":\"\\\"\",\"depth\":\"+\"}",
6892
+ "word": "\""
6893
+ }
6894
+ ],
6895
+ "(": [
6896
+ {
6897
+ "id": "leftParenthesis",
6898
+ "initial": "{\"word\":\"(\",\"value\":\"(\",\"depth\":\"+\"}",
6899
+ "word": "("
6900
+ }
6901
+ ],
6902
+ ")": [
6903
+ {
6904
+ "id": "rightParenthesis",
6905
+ "initial": "{\"word\":\")\",\"value\":\")\",\"depth\":\"-\"}",
6906
+ "word": ")"
6907
+ }
6908
+ ],
6909
+ ",": [
6910
+ {
6911
+ "id": "comma",
6912
+ "initial": "{\"word\":\",\",\"value\":\",\",\"depth\":\"+\"}",
6913
+ "word": ","
6914
+ }
6915
+ ],
6916
+ ".": [
6917
+ {
6918
+ "id": "endOfSentence",
6919
+ "initial": "{ value: \"endOfSentence\"}"
6920
+ }
6921
+ ],
6922
+ ":": [
6923
+ {
6924
+ "id": "colon",
6925
+ "initial": "{ value: \"colon\"}"
6926
+ }
6927
+ ],
6928
+ "memorable": [
6929
+ {
6930
+ "id": "memorable",
6931
+ "initial": "{\"word\":\"memorable\",\"number\":\"one\"}",
6932
+ "word": "memorable"
6933
+ }
6934
+ ],
6935
+ "memorables": [
6936
+ {
6937
+ "id": "memorable",
6938
+ "initial": "{\"word\":\"memorables\",\"number\":\"many\"}",
6939
+ "word": "memorables"
6940
+ }
6941
+ ],
6942
+ "nameable": [
6943
+ {
6944
+ "id": "nameable",
6945
+ "initial": "{\"word\":\"nameable\",\"number\":\"one\"}",
6946
+ "word": "nameable"
6947
+ }
6948
+ ],
6949
+ "nameables": [
6950
+ {
6951
+ "id": "nameable",
6952
+ "initial": "{\"word\":\"nameables\",\"number\":\"many\"}",
6953
+ "word": "nameables"
6954
+ }
6955
+ ],
6956
+ "the": [
6957
+ {
6958
+ "id": "the",
6959
+ "initial": "{ modifiers: [] }"
6960
+ }
6961
+ ]
6962
+ },
6963
+ "patterns": [
6964
+ ]
6965
+ }
6966
+ },
6967
+ "contexts": [
6968
+ {
6969
+ "context_id": 2,
6970
+ "context_index": 1,
6971
+ "dead": true,
6972
+ "default": true,
6973
+ "level": 1,
6974
+ "marker": "call",
6975
+ "name": [
6976
+ {
6977
+ "dead": true,
6978
+ "level": 0,
6979
+ "marker": "unknown",
6980
+ "range": {
6981
+ "end": 17,
6982
+ "start": 14
6983
+ },
6984
+ "text": "fred",
6985
+ "unknown": true,
6986
+ "value": "fred",
6987
+ "word": "fred"
6988
+ }
6989
+ ],
6990
+ "nameable": {
6991
+ "dead": true,
6992
+ "level": 0,
6993
+ "marker": "nameable",
6994
+ "number": "one",
6995
+ "range": {
6996
+ "end": 12,
6997
+ "start": 5
6998
+ },
6999
+ "text": "nameable",
7000
+ "types": [
7001
+ "nameable"
7002
+ ],
7003
+ "word": "nameable"
7004
+ },
7005
+ "range": {
7006
+ "end": 17,
7007
+ "start": 0
7008
+ },
7009
+ "text": "call nameable fred",
7010
+ "topLevel": true,
7011
+ "touchedBy": [
7012
+ "nameable#call2"
7013
+ ],
7014
+ "value": "call",
7015
+ "word": "call"
7016
+ },
7017
+ {
7018
+ "context_id": 3,
7019
+ "isResponse": true,
7020
+ "marker": "verbatim",
7021
+ "topLevel": true,
7022
+ "verbatim": "nameable is not known"
7023
+ }
7024
+ ],
7025
+ "developerTest": false,
7026
+ "generatedParenthesized": [
7027
+ "",
7028
+ "(nameable is not known)"
7029
+ ],
7030
+ "metadata": {
7031
+ "opChoices": [
7032
+ {
7033
+ "counter": 1,
7034
+ "op": [
7035
+ "unknown",
7036
+ 0
7037
+ ],
7038
+ "ops": [
7039
+ [
7040
+ "call",
7041
+ 0
7042
+ ],
7043
+ [
7044
+ "unknown",
7045
+ 0
7046
+ ]
7047
+ ]
7048
+ },
7049
+ {
7050
+ "counter": 2,
7051
+ "op": [
7052
+ "call",
7053
+ 0
7054
+ ],
7055
+ "ops": [
7056
+ [
7057
+ "call",
7058
+ 0
7059
+ ]
7060
+ ]
7061
+ }
7062
+ ]
7063
+ },
7064
+ "objects": {
7065
+ "nameToUUID": {
7066
+ "articles": "articles2",
7067
+ "evaluate": "evaluate2",
7068
+ "gdefaults": "gdefaults2",
7069
+ "nameable": "nameable1",
7070
+ "pos": "pos2",
7071
+ "punctuation": "punctuation2",
7072
+ "stm": "stm2",
7073
+ "tokenize": "tokenize2",
7074
+ "words": "words2"
7075
+ },
7076
+ "namespaced": {
7077
+ "articles2": {
7078
+ "km": "articles2"
7079
+ },
7080
+ "evaluate2": {
7081
+ "km": "evaluate2"
7082
+ },
7083
+ "gdefaults2": {
7084
+ "km": "gdefaults2"
7085
+ },
7086
+ "nameable1": {
7087
+ "km": "nameable1",
7088
+ "named": {
7089
+ }
7090
+ },
7091
+ "pos2": {
7092
+ "km": "pos2"
7093
+ },
7094
+ "punctuation2": {
7095
+ "km": "punctuation2"
7096
+ },
7097
+ "stm2": {
7098
+ "km": "stm2",
7099
+ "mentioned": [
7100
+ ],
7101
+ "variables": {
7102
+ }
7103
+ },
7104
+ "tokenize2": {
7105
+ "km": "tokenize2"
7106
+ },
7107
+ "words2": {
7108
+ "km": "words2",
7109
+ "words": [
7110
+ ]
7111
+ }
7112
+ },
7113
+ "processed": [
7114
+ {
7115
+ "context": {
7116
+ "context_id": 3,
7117
+ "isResponse": true,
7118
+ "marker": "verbatim",
7119
+ "topLevel": true,
7120
+ "verbatim": "nameable is not known"
7121
+ },
7122
+ "generatedParenthesized": [
7123
+ ],
7124
+ "paraphrases": [
7125
+ ],
7126
+ "paraphrasesParenthesized": [
7127
+ ],
7128
+ "responses": [
7129
+ "",
7130
+ "nameable is not known"
7131
+ ]
7132
+ },
7133
+ {
7134
+ "context": {
7135
+ "context_id": 2,
7136
+ "context_index": 1,
7137
+ "dead": true,
7138
+ "default": true,
7139
+ "level": 1,
7140
+ "marker": "call",
7141
+ "name": [
7142
+ {
7143
+ "dead": true,
7144
+ "level": 0,
7145
+ "marker": "unknown",
7146
+ "range": {
7147
+ "end": 17,
7148
+ "start": 14
7149
+ },
7150
+ "text": "fred",
7151
+ "unknown": true,
7152
+ "value": "fred",
7153
+ "word": "fred"
7154
+ }
7155
+ ],
7156
+ "nameable": {
7157
+ "dead": true,
7158
+ "level": 0,
7159
+ "marker": "nameable",
7160
+ "number": "one",
7161
+ "range": {
7162
+ "end": 12,
7163
+ "start": 5
7164
+ },
7165
+ "text": "nameable",
7166
+ "types": [
7167
+ "nameable"
7168
+ ],
7169
+ "word": "nameable"
7170
+ },
7171
+ "range": {
7172
+ "end": 17,
7173
+ "start": 0
7174
+ },
7175
+ "text": "call nameable fred",
7176
+ "topLevel": true,
7177
+ "touchedBy": [
7178
+ "nameable#call2"
7179
+ ],
7180
+ "value": "call",
7181
+ "word": "call"
7182
+ },
7183
+ "generatedParenthesized": [
7184
+ ],
7185
+ "paraphrases": [
7186
+ ],
7187
+ "paraphrasesParenthesized": [
7188
+ ],
7189
+ "responses": [
7190
+ "",
7191
+ "nameable is not known"
7192
+ ]
7193
+ }
7194
+ ]
7195
+ },
7196
+ "paraphrases": [
7197
+ "call nameable fred",
7198
+ "nameable is not known"
7199
+ ],
7200
+ "paraphrasesParenthesized": [
7201
+ "(call (nameable) (fred))",
7202
+ "(nameable is not known)"
7203
+ ],
7204
+ "query": "call nameable fred",
7205
+ "responses": [
7206
+ "",
7207
+ "nameable is not known"
7208
+ ],
7209
+ "summaries": [
7210
+ {
7211
+ "length": 1,
7212
+ "summaries": [
7213
+ {
7214
+ "counter": 1,
7215
+ "operators": [
7216
+ {
7217
+ "marker": [
7218
+ "call",
7219
+ 0
7220
+ ],
7221
+ "range": {
7222
+ "end": 3,
7223
+ "start": 0
7224
+ }
7225
+ },
7226
+ {
7227
+ "marker": [
7228
+ "nameable",
7229
+ 0
7230
+ ],
7231
+ "range": {
7232
+ "end": 12,
7233
+ "start": 5
7234
+ }
7235
+ },
7236
+ {
7237
+ "marker": [
7238
+ "unknown",
7239
+ 0
7240
+ ],
7241
+ "range": {
7242
+ "end": 17,
7243
+ "start": 14
7244
+ }
7245
+ }
7246
+ ]
7247
+ },
7248
+ {
7249
+ "counter": 2,
7250
+ "operators": [
7251
+ {
7252
+ "marker": [
7253
+ "call",
7254
+ 0
7255
+ ],
7256
+ "range": {
7257
+ "end": 3,
7258
+ "start": 0
7259
+ }
7260
+ },
7261
+ {
7262
+ "marker": [
7263
+ "nameable",
7264
+ 0
7265
+ ],
7266
+ "range": {
7267
+ "end": 12,
7268
+ "start": 5
7269
+ }
7270
+ },
7271
+ {
7272
+ "marker": [
7273
+ "unknown",
7274
+ 0
7275
+ ],
7276
+ "range": {
7277
+ "end": 17,
7278
+ "start": 14
7279
+ }
7280
+ }
7281
+ ]
7282
+ },
7283
+ {
7284
+ "counter": 3,
7285
+ "operators": [
7286
+ {
7287
+ "marker": [
7288
+ "call",
7289
+ 1
7290
+ ],
7291
+ "range": {
7292
+ "end": 17,
7293
+ "start": 0
7294
+ }
7295
+ }
7296
+ ]
7297
+ }
7298
+ ]
7299
+ }
7300
+ ]
6865
7301
  }
6866
7302
  ]
package/common/numbers.js CHANGED
@@ -114,7 +114,7 @@ knowledgeModule( {
114
114
  checks: {
115
115
  context: [
116
116
  defaultContextCheck({ marker: 'number', exported: true, extra: ['instance'] }),
117
- defaultContextCheck({ marker: 'integer', exported: true, extra: ['instance'] }),
117
+ defaultContextCheck({ match: ({isA, context}) => isA(context.marker, 'integer'), exported: true, extra: ['instance'] }),
118
118
  defaultContextCheck()
119
119
  ],
120
120
  }
@@ -2197,6 +2197,7 @@
2197
2197
  "value": [
2198
2198
  {
2199
2199
  "value": "like",
2200
+ "isVerb": true,
2200
2201
  "number": "one",
2201
2202
  "text": "x likes y",
2202
2203
  "marker": "like",
@@ -2243,6 +2244,7 @@
2243
2244
  },
2244
2245
  "operator": {
2245
2246
  "value": "like",
2247
+ "isVerb": true,
2246
2248
  "number": "one",
2247
2249
  "text": "likes",
2248
2250
  "marker": "like",
@@ -2253,7 +2255,6 @@
2253
2255
  },
2254
2256
  "evaluateWord": true,
2255
2257
  "imperative": false,
2256
- "isVerb": true,
2257
2258
  "level": 0
2258
2259
  },
2259
2260
  "unflatten": [
@@ -2284,6 +2285,7 @@
2284
2285
  },
2285
2286
  {
2286
2287
  "value": "love",
2288
+ "isVerb": true,
2287
2289
  "number": "one",
2288
2290
  "text": "x loves y",
2289
2291
  "marker": "love",
@@ -2330,6 +2332,7 @@
2330
2332
  },
2331
2333
  "operator": {
2332
2334
  "value": "love",
2335
+ "isVerb": true,
2333
2336
  "number": "one",
2334
2337
  "text": "loves",
2335
2338
  "marker": "love",
@@ -2340,7 +2343,6 @@
2340
2343
  },
2341
2344
  "evaluateWord": true,
2342
2345
  "imperative": false,
2343
- "isVerb": true,
2344
2346
  "level": 0
2345
2347
  },
2346
2348
  "unflatten": [