tpmkms_4wp 9.3.0-beta.6 → 9.3.0-beta.60

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 (111) hide show
  1. package/common/animals.instance.json +0 -65
  2. package/common/animals.js +2 -3
  3. package/common/animals.test.json +1607 -1
  4. package/common/articles.js +2 -4
  5. package/common/asking.js +21 -5
  6. package/common/avatar.js +2 -2
  7. package/common/characters.js +2 -2
  8. package/common/colors.instance.json +28 -70
  9. package/common/colors.js +2 -2
  10. package/common/comparable.instance.json +0 -15
  11. package/common/comparable.js +2 -2
  12. package/common/concept.js +1 -2
  13. package/common/concept.test.json +279 -193
  14. package/common/conjunction.js +3 -5
  15. package/common/countable.js +2 -14
  16. package/common/crew.instance.json +72 -130
  17. package/common/crew.js +2 -2
  18. package/common/currency.js +2 -3
  19. package/common/dateTimeSelectors.instance.json +175 -0
  20. package/common/dateTimeSelectors.js +168 -0
  21. package/common/dateTimeSelectors.test.json +85622 -0
  22. package/common/dates.instance.json +538 -506
  23. package/common/dates.js +112 -15
  24. package/common/dates.test.json +11021 -514
  25. package/common/dialogues.js +13 -49
  26. package/common/dimension.instance.json +0 -5
  27. package/common/dimension.js +4 -4
  28. package/common/edible.instance.json +56 -160
  29. package/common/edible.js +2 -2
  30. package/common/emotions.instance.json +0 -5
  31. package/common/emotions.js +2 -2
  32. package/common/errors.js +3 -0
  33. package/common/evaluate.js +2 -2
  34. package/common/events.js +1 -2
  35. package/common/fastfood.instance.json +172 -435
  36. package/common/fastfood.js +2 -4
  37. package/common/fastfood.test.json +16291 -6597
  38. package/common/formulas.instance.json +0 -5
  39. package/common/formulas.js +3 -1
  40. package/common/gdefaults.js +2 -3
  41. package/common/help.js +2 -2
  42. package/common/helpers/dateTimeSelectors.js +198 -0
  43. package/common/helpers/dialogues.js +11 -8
  44. package/common/helpers/properties.js +2 -2
  45. package/common/helpers.js +23 -47
  46. package/common/hierarchy.js +12 -13
  47. package/common/javascript.js +2 -3
  48. package/common/kirk.instance.json +0 -5
  49. package/common/kirk.js +2 -3
  50. package/common/length.instance.json +0 -75
  51. package/common/length.js +2 -3
  52. package/common/listener.js +3 -1
  53. package/common/math.instance.json +0 -5
  54. package/common/math.js +2 -3
  55. package/common/menus.instance.json +0 -35
  56. package/common/menus.js +3 -1
  57. package/common/meta.js +4 -5
  58. package/common/nameable.js +3 -1
  59. package/common/negation.js +2 -2
  60. package/common/numbers.js +7 -4
  61. package/common/numbers.test.json +89 -23
  62. package/common/ordering.instance.json +0 -10
  63. package/common/ordering.js +2 -3
  64. package/common/ordinals.js +2 -3
  65. package/common/people.instance.json +0 -40
  66. package/common/people.js +2 -3
  67. package/common/percentages.js +3 -4
  68. package/common/percentages.test.json +57 -11
  69. package/common/pipboy.instance.json +84 -85
  70. package/common/pipboy.js +1 -1
  71. package/common/pipboy.test.json +4377 -3386
  72. package/common/pokemon.instance.json +0 -65
  73. package/common/pokemon.js +1 -2
  74. package/common/pos.js +2 -2
  75. package/common/pressure.instance.json +0 -20
  76. package/common/pressure.js +2 -2
  77. package/common/properties.instance.json +0 -5
  78. package/common/properties.js +11 -13
  79. package/common/punctuation.js +2 -2
  80. package/common/reminders.instance.json +153 -23
  81. package/common/reminders.js +275 -82
  82. package/common/reminders.test.json +75654 -37
  83. package/common/reports.instance.json +1 -11
  84. package/common/reports.js +1 -1
  85. package/common/scorekeeper.js +2 -2
  86. package/common/scorekeeper.test.json +3565 -7550
  87. package/common/sdefaults.js +1 -1
  88. package/common/self.js +1 -1
  89. package/common/sizeable.js +2 -2
  90. package/common/spock.instance.json +0 -5
  91. package/common/spock.js +1 -1
  92. package/common/stgame.js +1 -1
  93. package/common/stm.js +1 -1
  94. package/common/tell.js +2 -2
  95. package/common/temperature.instance.json +84 -20
  96. package/common/temperature.js +2 -2
  97. package/common/tester.js +0 -1
  98. package/common/testing.js +0 -1
  99. package/common/time.js +57 -30
  100. package/common/time.test.json +4159 -205
  101. package/common/tokenize.js +1 -1
  102. package/common/ui.instance.json +0 -5
  103. package/common/ui.js +4 -2
  104. package/common/weight.instance.json +0 -112
  105. package/common/weight.js +2 -2
  106. package/common/wp.instance.json +56 -70
  107. package/common/wp.js +1 -3
  108. package/common/wp.test.json +8057 -3867
  109. package/common/yesno.js +2 -2
  110. package/main.js +2 -0
  111. package/package.json +8 -4
@@ -66,7 +66,7 @@ knowledgeModule({
66
66
  name: './sdefaults.test.json',
67
67
  contents: sdefaults_tests,
68
68
  checks: {
69
- context: defaultContextCheck(),
69
+ context: [defaultContextCheck()],
70
70
  },
71
71
  },
72
72
  })
package/common/self.js CHANGED
@@ -43,7 +43,7 @@ knowledgeModule( {
43
43
  name: './self.test.json',
44
44
  contents: self_tests,
45
45
  checks: {
46
- context: defaultContextCheck(),
46
+ context: [defaultContextCheck()],
47
47
  },
48
48
  }
49
49
  })
@@ -62,7 +62,7 @@ knowledgeModule({
62
62
  name: './sizeable.test.json',
63
63
  contents: sizeable_tests,
64
64
  checks: {
65
- context: [ ...defaultContextCheck(), { property: 'size', filter: ['value'] } ],
66
- },
65
+ context: [defaultContextCheck()],
66
+ }
67
67
  },
68
68
  })
@@ -500,11 +500,6 @@
500
500
  "theAble",
501
501
  false
502
502
  ],
503
- [
504
- "evaluate",
505
- "verb",
506
- false
507
- ],
508
503
  [
509
504
  "every",
510
505
  "article",
package/common/spock.js CHANGED
@@ -23,7 +23,7 @@ knowledgeModule( {
23
23
  name: './spock.test.json',
24
24
  contents: spock_tests,
25
25
  checks: {
26
- context: defaultContextCheck(),
26
+ context: [defaultContextCheck()],
27
27
  },
28
28
  },
29
29
  template: {
package/common/stgame.js CHANGED
@@ -88,7 +88,7 @@ knowledgeModule( {
88
88
  name: './stgame.test.json',
89
89
  contents: stgame_tests,
90
90
  checks: {
91
- context: defaultContextCheck(),
91
+ context: [defaultContextCheck()],
92
92
  },
93
93
  },
94
94
  })
package/common/stm.js CHANGED
@@ -270,7 +270,7 @@ knowledgeModule( {
270
270
  name: './stm.test.json',
271
271
  contents: stm_tests,
272
272
  checks: {
273
- context: [...defaultContextCheck(), 'pullFromContext', 'stm_id'],
273
+ context: [defaultContextCheck({ extra: ['pullFromContext', 'stm_id'] })],
274
274
  objects: [{ property: 'mentioned', filter: helpers.defaultContextCheckProperties }],
275
275
  },
276
276
  },
package/common/tell.js CHANGED
@@ -121,7 +121,7 @@ knowledgeModule( {
121
121
  name: './tell.test.json',
122
122
  contents: tell_tests,
123
123
  checks: {
124
- context: defaultContextCheck(),
125
- },
124
+ context: [defaultContextCheck({ extra: ['event', 'info', 'target'] })],
125
+ },
126
126
  },
127
127
  })
@@ -243,11 +243,6 @@
243
243
  "article",
244
244
  false
245
245
  ],
246
- [
247
- "evaluate",
248
- "verb",
249
- false
250
- ],
251
246
  [
252
247
  "every",
253
248
  "article",
@@ -1675,11 +1670,6 @@
1675
1670
  "article",
1676
1671
  false
1677
1672
  ],
1678
- [
1679
- "evaluate",
1680
- "verb",
1681
- false
1682
- ],
1683
1673
  [
1684
1674
  "every",
1685
1675
  "article",
@@ -3919,11 +3909,6 @@
3919
3909
  "article",
3920
3910
  false
3921
3911
  ],
3922
- [
3923
- "evaluate",
3924
- "verb",
3925
- false
3926
- ],
3927
3912
  [
3928
3913
  "every",
3929
3914
  "article",
@@ -6397,11 +6382,6 @@
6397
6382
  "article",
6398
6383
  false
6399
6384
  ],
6400
- [
6401
- "evaluate",
6402
- "verb",
6403
- false
6404
- ],
6405
6385
  [
6406
6386
  "every",
6407
6387
  "article",
@@ -7827,6 +7807,48 @@
7827
7807
  0
7828
7808
  ]
7829
7809
  ],
7810
+ [
7811
+ [
7812
+ "celcius",
7813
+ 0
7814
+ ],
7815
+ [
7816
+ "divideByOperator",
7817
+ 0
7818
+ ],
7819
+ [
7820
+ "equals",
7821
+ 0
7822
+ ],
7823
+ [
7824
+ "fahrenheit",
7825
+ 0
7826
+ ],
7827
+ [
7828
+ "integer",
7829
+ 0
7830
+ ],
7831
+ [
7832
+ "leftParenthesis",
7833
+ 0
7834
+ ],
7835
+ [
7836
+ "minusOperator",
7837
+ 0
7838
+ ],
7839
+ [
7840
+ "plusOperator",
7841
+ 0
7842
+ ],
7843
+ [
7844
+ "rightParenthesis",
7845
+ 0
7846
+ ],
7847
+ [
7848
+ "timesOperator",
7849
+ 0
7850
+ ]
7851
+ ],
7830
7852
  [
7831
7853
  [
7832
7854
  "celcius",
@@ -9402,6 +9424,48 @@
9402
9424
  0
9403
9425
  ]
9404
9426
  ],
9427
+ [
9428
+ [
9429
+ "celcius",
9430
+ 0
9431
+ ],
9432
+ [
9433
+ "divideByOperator",
9434
+ 0
9435
+ ],
9436
+ [
9437
+ "equals",
9438
+ 0
9439
+ ],
9440
+ [
9441
+ "fahrenheit",
9442
+ 0
9443
+ ],
9444
+ [
9445
+ "integer",
9446
+ 0
9447
+ ],
9448
+ [
9449
+ "leftParenthesis",
9450
+ 0
9451
+ ],
9452
+ [
9453
+ "minusOperator",
9454
+ 0
9455
+ ],
9456
+ [
9457
+ "plusOperator",
9458
+ 0
9459
+ ],
9460
+ [
9461
+ "rightParenthesis",
9462
+ 0
9463
+ ],
9464
+ [
9465
+ "timesOperator",
9466
+ 0
9467
+ ]
9468
+ ],
9405
9469
  [
9406
9470
  [
9407
9471
  "celcius",
@@ -24,8 +24,8 @@ knowledgeModule({
24
24
  name: './temperature.test.json',
25
25
  contents: temperature_tests,
26
26
  checks: {
27
- context: defaultContextCheck(),
28
- },
27
+ context: [defaultContextCheck()],
28
+ },
29
29
  },
30
30
  template: {
31
31
  template,
package/common/tester.js CHANGED
@@ -1,5 +1,4 @@
1
1
  const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
- const { defaultContextCheck } = require('./helpers')
3
2
  const tester_tests = require('./tester.test.json')
4
3
  const ArgumentParser = require('argparse').ArgumentParser
5
4
 
package/common/testing.js CHANGED
@@ -1,5 +1,4 @@
1
1
  const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
- const { defaultContextCheck } = require('./helpers')
3
2
  const testing_tests = require('./testing.test.json')
4
3
  const gdefaults = require('./gdefaults')
5
4
 
package/common/time.js CHANGED
@@ -29,6 +29,14 @@ class API {
29
29
  context.event = promise
30
30
  }
31
31
 
32
+ now() {
33
+ if (this.args.isProcess || this.args.isTest) {
34
+ return new Date(2025, 5, 29, 14, 52, 0)
35
+ } else {
36
+ return new Date()
37
+ }
38
+ }
39
+
32
40
  newDate() {
33
41
  return new Date()
34
42
  }
@@ -41,8 +49,11 @@ const config = {
41
49
  name: 'time',
42
50
  operators: [
43
51
  "([time])",
52
+ "([atTime|at] (time))",
44
53
  "([use] (([timeUnit]) [timeFormat|format]))",
45
- "(([number|]) [ampm|])"
54
+ // "(([number|]) [ampm|])",
55
+ "((time) [ampm|])",
56
+ "([hourMinutes|] (integer) (colon) (integer))",
46
57
  //"(([anyConcept]) [equals|is] ([anyConcept]))",
47
58
  //"(([what0|what]) [equals] (<the> ([timeConcept])))",
48
59
  //"(<whatP|what> ([anyConcept]))",
@@ -53,26 +64,47 @@ const config = {
53
64
  // how many hours are in a day
54
65
  ],
55
66
  bridges: [
56
- { "id": "time", "level": 0, "bridge": "{ ...next(operator) }" },
57
-
58
- // { "id": "hourUnits", "level": 0, "bridge": "{ ...next(operator) }" },
59
- { "id": "ampm", "level": 0, "bridge": "{ ...next(operator), hour: before[0] }" },
60
-
61
- { "id": "timeFormat", "level": 0, "bridge": "{ ...before[0], ...next(operator) }" },
62
- // { "id": "count", "level": 0, "bridge": "{ ...after, count: operator.value }" },
67
+ {
68
+ id: 'hourMinutes',
69
+ isA: ['time'],
70
+ convolution: true,
71
+ bridge: "{ ...next(operator), hour: after[0], colon: after[1], minute: after[2], interpolate: '${hour}${colon}${minute}' }",
72
+ },
73
+ {
74
+ id: "atTime",
75
+ words: ['@'],
76
+ isA: ['preposition'],
77
+ bridge: "{ ...next(operator), time: after[0], operator: operator, interpolate: '${operator} ${time}' }"
78
+ },
79
+ {
80
+ id: "time",
81
+ bridge: "{ ...next(operator) }"
82
+ },
63
83
  {
64
- "id": "timeUnit",
65
- "level": 0,
84
+ id: "ampm",
85
+ isA: ['adjective'],
86
+ localHierarchy: [
87
+ ['integer', 'time'],
88
+ ],
89
+ bridge: "{ ...next(before[0]), marker: if(isA(before[0].marker, 'integer'), operator('time'), before[0].marker), ampm: operator, time: before[0], interpolate: concat(default(before[0].interpolate, '${time}'), ' ${ampm}') }",
90
+ },
91
+ {
92
+ id: "timeFormat",
93
+ bridge: "{ ...before[0], ...next(operator) }"
94
+ },
95
+ {
96
+ id: "timeUnit",
66
97
  words: [
67
98
  ...helpers.words('hour', { initial: "{ units: 'hour' }" }),
68
99
  ...helpers.words('minute', { initial: "{ units: 'minute' }" }),
69
100
  ...helpers.words('second', { initial: "{ units: 'second' }" }),
70
101
  ],
71
- "bridge": "{ ...next(operator) }"
102
+ bridge: "{ ...next(operator) }"
72
103
  },
73
- { "id": "use", "level": 0,
74
- bridge: "{ ...next(operator), format: after[0] }",
75
- generatorp: ({g, context}) => `use ${context.format.quantity.value} hour time`
104
+ {
105
+ id: "use",
106
+ bridge: "{ ...next(operator), format: after[0] }",
107
+ generatorp: ({g, context}) => `use ${context.format.quantity.value} hour time`
76
108
  },
77
109
  ],
78
110
  hierarchy: [
@@ -84,26 +116,21 @@ const config = {
84
116
 
85
117
  "words": {
86
118
  "literals": {
87
- // " ([0-9]+)": [{"id": "count", "initial": "{ value: int(group[0]) }" }],
88
- // " (1[0-2]|[1-9])": [{"id": "hourUnits", "initial": "{ hour: int(group[0]) }" }],
89
- "am": [{"id": "ampm", "initial": "{ ampm: 'am', determined: true }" }],
90
- "pm": [{"id": "ampm", "initial": "{ ampm: 'pm', determined: true }" }],
91
- //" (1[0-2]|[1-9]) ?pm": [{"id": "count", "initial": "{ hour: int(group[0]), part: 'pm' }" }],
92
- //" (1[0-2]|[1-9]) ?am": [{"id": "count", "initial": "{ hour: int(group[0]), part: 'am' }" }],
119
+ // " ([0-9]+)": [{id: "count", "initial": "{ value: int(group[0]) }" }],
120
+ // " (1[0-2]|[1-9])": [{id: "hourUnits", "initial": "{ hour: int(group[0]) }" }],
121
+ "am": [{id: "ampm", "initial": "{ ampm: 'am', determined: true }" }],
122
+ "pm": [{id: "ampm", "initial": "{ ampm: 'pm', determined: true }" }],
123
+ //" (1[0-2]|[1-9]) ?pm": [{id: "count", "initial": "{ hour: int(group[0]), part: 'pm' }" }],
124
+ //" (1[0-2]|[1-9]) ?am": [{id: "count", "initial": "{ hour: int(group[0]), part: 'am' }" }],
93
125
  /*
94
- " hours?": [{"id": "timeUnit", "initial": "{ units: 'hour' }" }],
95
- " minutes?": [{"id": "timeUnit", "initial": "{ units: 'hour' }" }],
96
- " seconds?": [{"id": "timeUnit", "initial": "{ units: 'seconds' }" }],
126
+ " hours?": [{id: "timeUnit", "initial": "{ units: 'hour' }" }],
127
+ " minutes?": [{id: "timeUnit", "initial": "{ units: 'hour' }" }],
128
+ " seconds?": [{id: "timeUnit", "initial": "{ units: 'seconds' }" }],
97
129
  */
98
130
  }
99
131
  },
100
132
 
101
133
  generators: [
102
- {
103
- where: where(),
104
- match: ({context}) => context.marker == 'ampm' && context.paraphrase,
105
- apply: async ({g, context, gp}) => `${await gp(context.hour)} ${context.ampm}`
106
- },
107
134
  {
108
135
  where: where(),
109
136
  match: ({context}) => context.marker == 'time' && context.evalue && context.format == 12,
@@ -194,7 +221,7 @@ knowledgeModule({
194
221
  name: './time.test.json',
195
222
  contents: time_tests,
196
223
  checks: {
197
- context: defaultContextCheck(),
198
- },
224
+ context: [defaultContextCheck({ extra: ['one', 'two', 'events', 'time', 'ampm'] })],
225
+ }
199
226
  },
200
227
  })