tpmkms_4wp 9.5.1 → 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.
- package/common/animals.instance.json +21 -61
- package/common/asking.js +116 -106
- package/common/avatar.test.json +1001 -860
- package/common/can.instance.json +2174 -0
- package/common/can.js +254 -0
- package/common/can.test.json +51307 -0
- package/common/characters.js +5 -5
- package/common/colors.instance.json +12 -12
- package/common/comparable.instance.json +3 -3
- package/common/concept.js +25 -27
- package/common/concept.test.json +180 -144
- package/common/conjunction.js +13 -5
- package/common/conjunction.test.json +32 -42
- package/common/crew.instance.json +196 -160
- package/common/crew.js +1 -1
- package/common/crew.test.json +4148 -3324
- package/common/currency.js +1 -1
- package/common/dateTimeSelectors.instance.json +2 -2
- package/common/dateTimeSelectors.js +3 -3
- package/common/dateTimeSelectors.test.json +76935 -35739
- package/common/dates.instance.json +3 -3
- package/common/dates.test.json +284 -287
- package/common/dialogues.js +41 -119
- package/common/dialogues.test.json +1171 -996
- package/common/dimension.instance.json +21369 -557
- package/common/dimension.js +148 -54
- package/common/dimension.test.json +8753 -3495
- package/common/drone.instance.json +23712 -0
- package/common/drone.js +448 -0
- package/common/drone.test.json +66665 -0
- package/common/edible.instance.json +32 -32
- package/common/emotions.instance.json +75 -76
- package/common/emotions.js +1 -1
- package/common/emotions.test.json +242 -174
- package/common/english_helpers.js +336 -0
- package/common/errors.js +6 -6
- package/common/evaluate.js +2 -2
- package/common/events.js +8 -8
- package/common/fastfood.instance.json +389 -245
- package/common/fastfood.js +11 -11
- package/common/fastfood.test.json +6970 -6829
- package/common/formulas.instance.json +1 -1
- package/common/formulas.js +1 -1
- package/common/gdefaults.js +111 -17
- package/common/help.js +12 -12
- package/common/help.test.json +65 -11
- package/common/helpers/concept.js +1 -1
- package/common/helpers/conjunction.js +54 -44
- package/common/helpers/dateTimeSelectors.js +2 -2
- package/common/helpers/dialogues.js +7 -2
- package/common/helpers/formulas.js +13 -11
- package/common/helpers/menus.js +12 -12
- package/common/helpers/meta.js +9 -9
- package/common/helpers/properties.js +185 -62
- package/common/helpers.js +167 -48
- package/common/hierarchy.js +6 -4
- package/common/kirk.instance.json +1 -1
- package/common/kirk.test.json +600 -424
- package/common/latin.instance.json +12 -12
- package/common/latin.js +9 -9
- package/common/length.instance.json +27612 -2890
- package/common/length.js +6 -1
- package/common/length.test.json +45315 -3925
- package/common/math.instance.json +29 -29
- package/common/math.js +47 -46
- package/common/menus.instance.json +7 -10
- package/common/menus.js +2 -9
- package/common/meta.js +77 -60
- package/common/nameable.js +20 -13
- package/common/nameable.test.json +436 -0
- package/common/numbers.js +1 -1
- package/common/ordering.instance.json +87 -19
- package/common/ordering.js +1 -1
- package/common/ordering.test.json +835 -417
- package/common/people.instance.json +96 -348
- package/common/people.js +6 -4
- package/common/people.test.json +4135 -3606
- package/common/pipboy.instance.json +17 -17
- package/common/pipboy.js +2 -3
- package/common/pokemon.instance.json +13 -13
- package/common/pokemon.js +1 -1
- package/common/pressure.instance.json +3579 -1610
- package/common/pressure.test.json +433 -477
- package/common/properties.instance.json +6 -17
- package/common/properties.js +25 -7
- package/common/properties.test.json +9565 -6951
- package/common/rates.instance.json +59 -0
- package/common/rates.js +97 -0
- package/common/rates.test.json +27702 -0
- package/common/reminders.instance.json +4 -4
- package/common/reminders.js +5 -5
- package/common/reminders.test.json +64635 -25787
- package/common/reports.instance.json +3 -3
- package/common/reports.js +18 -16
- package/common/scorekeeper.js +6 -6
- package/common/sdefaults.js +22 -2
- package/common/spock.instance.json +1 -1
- package/common/spock.test.json +606 -430
- package/common/stgame.js +1 -1
- package/common/stm.js +17 -6
- package/common/tell.js +1 -1
- package/common/temperature.instance.json +3659 -1690
- package/common/temperature.test.json +433 -477
- package/common/tester.js +3 -3
- package/common/time.instance.json +24762 -0
- package/common/time.js +137 -141
- package/common/time.test.json +31876 -3757
- package/common/tokenize.js +5 -2
- package/common/ui.instance.json +2 -5
- package/common/ui.js +1 -8
- package/common/weight.instance.json +10360 -4078
- package/common/weight.test.json +2601 -2263
- package/common/words.instance.json +9 -0
- package/common/words.js +53 -0
- package/common/words.test.json +2 -0
- package/common/wp.instance.json +408 -8
- package/common/wp.js +8 -4
- package/common/wp.test.json +7385 -6906
- package/main.js +4 -2
- package/package.json +20 -5
- package/common/listener.js +0 -50
- package/common/listener.test.json +0 -142
package/common/meta.js
CHANGED
|
@@ -26,13 +26,13 @@ const config = {
|
|
|
26
26
|
"(([orAble|]) [orList|or] ([orAble|]))",
|
|
27
27
|
// "cats is the plural of cat"
|
|
28
28
|
// "is cat the plural of cats"
|
|
29
|
-
{ pattern: "([x])",
|
|
29
|
+
{ pattern: "([x])", scope: "testing" },
|
|
30
30
|
// if f x then g x
|
|
31
|
-
{ pattern: "([e])",
|
|
32
|
-
{ pattern: "([f])",
|
|
33
|
-
{ pattern: "([g])",
|
|
34
|
-
{ pattern: "([undefined])",
|
|
35
|
-
{ pattern: "([defined])",
|
|
31
|
+
{ pattern: "([e])", scope: "testing" },
|
|
32
|
+
{ pattern: "([f])", scope: "testing" },
|
|
33
|
+
{ pattern: "([g])", scope: "testing" },
|
|
34
|
+
{ pattern: "([undefined])", scope: "testing" },
|
|
35
|
+
{ pattern: "([defined])", scope: "testing" },
|
|
36
36
|
|
|
37
37
|
/*
|
|
38
38
|
if creating a new word make a motivation to ask if word is plura or singlar of anohter wordA
|
|
@@ -61,9 +61,9 @@ const config = {
|
|
|
61
61
|
// [['means', 0], ['is', 0]],
|
|
62
62
|
],
|
|
63
63
|
hierarchy: [
|
|
64
|
-
{ child: 'e', parent: 'orAble',
|
|
65
|
-
{ child: 'f', parent: 'orAble',
|
|
66
|
-
{ child: 'g', parent: 'ifAble',
|
|
64
|
+
{ child: 'e', parent: 'orAble', scope: "testing" },
|
|
65
|
+
{ child: 'f', parent: 'orAble', scope: "testing" },
|
|
66
|
+
{ child: 'g', parent: 'ifAble', scope: "testing" },
|
|
67
67
|
{ child: 'orAble', parent: 'ifAble' },
|
|
68
68
|
],
|
|
69
69
|
bridges: [
|
|
@@ -94,12 +94,12 @@ const config = {
|
|
|
94
94
|
{ id: "then", level: 0, bridge: "{ ...next(operator), consequence: after[0] }" },
|
|
95
95
|
{ id: "ifAble" },
|
|
96
96
|
{ id: "orAble" },
|
|
97
|
-
{ id: "x",
|
|
98
|
-
{ id: "e",
|
|
99
|
-
{ id: "f",
|
|
100
|
-
{ id: "g",
|
|
101
|
-
{ id: "undefined",
|
|
102
|
-
{ id: "defined",
|
|
97
|
+
{ id: "x", scope: "testing" },
|
|
98
|
+
{ id: "e", scope: "testing" },
|
|
99
|
+
{ id: "f", scope: "testing" },
|
|
100
|
+
{ id: "g", scope: "testing" },
|
|
101
|
+
{ id: "undefined", scope: "testing" },
|
|
102
|
+
{ id: "defined", scope: "testing" },
|
|
103
103
|
// { id: "testWord2", level: 0, bridge: "{ ...next(operator) }" },
|
|
104
104
|
],
|
|
105
105
|
version: '3',
|
|
@@ -107,12 +107,12 @@ const config = {
|
|
|
107
107
|
"literals": {
|
|
108
108
|
// 'testWord2': [{"id": "testWord2", "initial": "{ value: 'testWord2Value' }" }],
|
|
109
109
|
// TODO make this development and select out for module
|
|
110
|
-
// 'x': [{id: "x", initial: "{ value: 'x' }",
|
|
111
|
-
// 'f': [{id: "ifAble", initial: "{ word: 'f' }",
|
|
112
|
-
// 'g': [{id: "ifAble", initial: "{ word: 'g' }",
|
|
113
|
-
'f': [{id: "f", initial: "{ value: 'f', word: 'f' }",
|
|
114
|
-
'x': [{id: "x", initial: "{ value: 'x', word: 'x' }",
|
|
115
|
-
'gq': [{id: "g", initial: "{ word: 'gq', query: true }",
|
|
110
|
+
// 'x': [{id: "x", initial: "{ value: 'x' }", scope: "testing" }],
|
|
111
|
+
// 'f': [{id: "ifAble", initial: "{ word: 'f' }", scope: "testing" }],
|
|
112
|
+
// 'g': [{id: "ifAble", initial: "{ word: 'g' }", scope: "testing" }],
|
|
113
|
+
'f': [{id: "f", initial: "{ value: 'f', word: 'f' }", scope: "testing" }],
|
|
114
|
+
'x': [{id: "x", initial: "{ value: 'x', word: 'x' }", scope: "testing" }],
|
|
115
|
+
'gq': [{id: "g", initial: "{ word: 'gq', query: true }", scope: "testing" }],
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
118
|
generators: [
|
|
@@ -120,19 +120,19 @@ const config = {
|
|
|
120
120
|
where: where(),
|
|
121
121
|
match: ({context}) => context.marker == 'undefined',
|
|
122
122
|
apply: ({context}) => 'undefined',
|
|
123
|
-
|
|
123
|
+
scope: "testing",
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
126
|
where: where(),
|
|
127
127
|
match: ({context}) => context.marker == 'defined',
|
|
128
128
|
apply: ({context}) => 'defined',
|
|
129
|
-
|
|
129
|
+
scope: "testing",
|
|
130
130
|
},
|
|
131
131
|
{
|
|
132
132
|
where: where(),
|
|
133
133
|
match: ({context}) => context.evalue && !context.paraphrase,
|
|
134
134
|
apply: ({context}) => context.evalue.verbatim,
|
|
135
|
-
|
|
135
|
+
scope: "testing",
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
where: where(),
|
|
@@ -154,13 +154,13 @@ const config = {
|
|
|
154
154
|
where: where(),
|
|
155
155
|
match: ({context}) => context.marker === 'ifAble',
|
|
156
156
|
apply: ({context}) => context.value,
|
|
157
|
-
|
|
157
|
+
scope: "testing",
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
where: where(),
|
|
161
161
|
match: ({context}) => ['x', 'g', 'f', 'e', 'ifAble'].includes(context.marker),
|
|
162
162
|
apply: ({context}) => `${context.word}`,
|
|
163
|
-
|
|
163
|
+
scope: "testing",
|
|
164
164
|
},
|
|
165
165
|
{
|
|
166
166
|
where: where(),
|
|
@@ -182,7 +182,7 @@ const config = {
|
|
|
182
182
|
}
|
|
183
183
|
context.isResponse = true
|
|
184
184
|
},
|
|
185
|
-
|
|
185
|
+
scope: "testing",
|
|
186
186
|
},
|
|
187
187
|
{
|
|
188
188
|
where: where(),
|
|
@@ -206,10 +206,14 @@ const config = {
|
|
|
206
206
|
// setup the read semantic
|
|
207
207
|
|
|
208
208
|
// !topLevel or maybe !value??!?!
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
function match(defContext) {
|
|
210
|
+
return ({context}) => context.marker == (defContext.consequence || {}).marker && context.query // && !context.value
|
|
211
|
+
}
|
|
212
|
+
function apply(DEFINITIONs, DERIVED) {
|
|
211
213
|
const mappingss = translationMappings(DEFINITIONs, DERIVED)
|
|
212
|
-
|
|
214
|
+
function invertMappings(mappings) {
|
|
215
|
+
return mappings.map( ({ from, to }) => { return { to: from, from: to } } )
|
|
216
|
+
}
|
|
213
217
|
return async ({context, s, config}) => {
|
|
214
218
|
DEFINITIONs = _.cloneDeep(DEFINITIONs)
|
|
215
219
|
//const mappings = mappingss[0]
|
|
@@ -292,6 +296,7 @@ const config = {
|
|
|
292
296
|
}
|
|
293
297
|
if (context.to.value) {
|
|
294
298
|
kms.stm.api.setVariable(context.from.value, context.to.value)
|
|
299
|
+
// config.addWord(context.from.word, context.to)
|
|
295
300
|
} else {
|
|
296
301
|
await kms.dialogues.api.makeObject({ context: context.from, types: context.to.types || [], config });
|
|
297
302
|
kms.stm.api.setVariable(context.from.value, context.to)
|
|
@@ -306,15 +311,21 @@ const config = {
|
|
|
306
311
|
apply: async ({config, context, g}) => {
|
|
307
312
|
// setup the write semantic
|
|
308
313
|
{
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
314
|
+
function matchByMarker(defContext) {
|
|
315
|
+
return ({context}) => context.marker == defContext.from.marker && !context.query && !context.objects
|
|
316
|
+
}
|
|
317
|
+
function matchByValue(defContext) {
|
|
318
|
+
return ({context}) => context.evalue == defContext.from.value && !context.query && !context.objects
|
|
319
|
+
}
|
|
320
|
+
function apply(mappings, TO) {
|
|
321
|
+
return async ({context, s}) => {
|
|
322
|
+
TO = _.cloneDeep(TO)
|
|
323
|
+
for (const { from, to } of mappings) {
|
|
324
|
+
hashIndexesSet(TO, to, hashIndexesGet(context, from))
|
|
325
|
+
}
|
|
326
|
+
toPrime = await s(TO)
|
|
327
|
+
context.result = toPrime.result
|
|
315
328
|
}
|
|
316
|
-
toPrime = await s(TO)
|
|
317
|
-
context.result = toPrime.result
|
|
318
329
|
}
|
|
319
330
|
const mappings = translationMapping(context.from, context.to)
|
|
320
331
|
let match = matchByMarker(context)
|
|
@@ -333,30 +344,36 @@ const config = {
|
|
|
333
344
|
|
|
334
345
|
// setup the read semantic
|
|
335
346
|
{
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
347
|
+
function matchByMarker(defContext) {
|
|
348
|
+
return ({context, uuid}) => context.marker == defContext.from.marker && (context.query || context.evaluate) && !context[`disable${uuid}`]
|
|
349
|
+
}
|
|
350
|
+
function matchByValue(defContext) {
|
|
351
|
+
return ({context, uuid}) => context.value == defContext.from.value && (context.query || context.evaluate) && !context[`disable${uuid}`]
|
|
352
|
+
}
|
|
353
|
+
function apply(mappings, TO) {
|
|
354
|
+
return async ({uuid, context, s, g, config}) => {
|
|
355
|
+
TO = _.cloneDeep(TO)
|
|
356
|
+
for (const { from, to } of mappings) {
|
|
357
|
+
hashIndexesSet(TO, to, hashIndexesGet(context, from))
|
|
358
|
+
}
|
|
359
|
+
// next move add debug arg to s and g
|
|
360
|
+
// TODO why is there query and evaluate?
|
|
361
|
+
if (context.query) {
|
|
362
|
+
TO.query = context.query
|
|
363
|
+
} else {
|
|
364
|
+
TO.evaluate = context.evaluate
|
|
365
|
+
}
|
|
366
|
+
TO[`disable${uuid}`] = true
|
|
367
|
+
toPrime = await s(TO)
|
|
368
|
+
if (context.query) {
|
|
369
|
+
if (toPrime.evalue) {
|
|
370
|
+
context.evalue = toPrime.evalue
|
|
371
|
+
} else {
|
|
372
|
+
context.evalue = toPrime
|
|
373
|
+
}
|
|
355
374
|
} else {
|
|
356
|
-
context.evalue = toPrime
|
|
375
|
+
context.evalue = toPrime.evalue
|
|
357
376
|
}
|
|
358
|
-
} else {
|
|
359
|
-
context.evalue = toPrime.evalue
|
|
360
377
|
}
|
|
361
378
|
}
|
|
362
379
|
const mappings = translationMapping(context.from, context.to)
|
package/common/nameable.js
CHANGED
|
@@ -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')
|
|
@@ -77,25 +77,25 @@ const config = {
|
|
|
77
77
|
operators: [
|
|
78
78
|
// "([call] ([nameable]) (name))",
|
|
79
79
|
"([call] ([nameable]) (!@<=endOfSentence)*)",
|
|
80
|
-
{ pattern: "([getNamesByType] (type))",
|
|
81
|
-
{ pattern: "([m1])",
|
|
82
|
-
// { pattern: "([testPullFromContext] ([memorable]))",
|
|
80
|
+
{ pattern: "([getNamesByType] (type))", scope: "testing" },
|
|
81
|
+
{ pattern: "([m1])", scope: "testing" },
|
|
82
|
+
// { pattern: "([testPullFromContext] ([memorable]))", scope: "testing" }
|
|
83
83
|
],
|
|
84
84
|
words: {
|
|
85
85
|
literals: {
|
|
86
|
-
// "m1": [{"id": "memorable",
|
|
87
|
-
// "m2": [{"id": "memorable",
|
|
86
|
+
// "m1": [{"id": "memorable", scope: "testing", "initial": "{ value: 'm1' }" }],
|
|
87
|
+
// "m2": [{"id": "memorable", scope: "testing", "initial": "{ value: 'm2' }" }],
|
|
88
88
|
},
|
|
89
89
|
},
|
|
90
90
|
bridges: [
|
|
91
91
|
{
|
|
92
92
|
id: 'm1',
|
|
93
93
|
isA: ['memorable', 'nameable'],
|
|
94
|
-
|
|
94
|
+
scope: "testing",
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
97
|
id: 'getNamesByType',
|
|
98
|
-
|
|
98
|
+
scope: "testing",
|
|
99
99
|
isA: ['verb'],
|
|
100
100
|
bridge: "{ ...next(operator), type: after[0] }",
|
|
101
101
|
semantic: async ({context, api}) => {
|
|
@@ -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
|
|