tpmkms 9.8.0 → 9.9.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/actions.instance.json +10 -8
- package/common/actions.js +13 -11
- package/common/angle.instance.json +25 -17
- package/common/animals.instance.json +54 -28
- package/common/askfor.instance.json +89 -192
- package/common/askfor.js +49 -12
- package/common/asking.js +13 -5
- package/common/avatar.js +3 -3
- package/common/can.instance.json +32 -20
- package/common/can.js +2 -2
- package/common/colors.instance.json +44 -16
- package/common/colors.js +1 -1
- package/common/comparable.instance.json +25 -22
- package/common/compass.instance.json +9 -3
- package/common/concept.instance.json +14 -6
- package/common/concept.js +2 -0
- package/common/conjunction.js +17 -9
- package/common/control.js +10 -18
- package/common/countable.js +4 -3
- package/common/crew.instance.json +95 -27
- package/common/dateTimeSelectors.instance.json +4 -4
- package/common/dateTimeSelectors.js +4 -7
- package/common/dates.instance.json +52 -28
- package/common/dates.js +16 -11
- package/common/debug.instance.json +48 -0
- package/common/debug.js +50 -0
- package/common/debug.test.json +1 -0
- package/common/dialogues.js +126 -70
- package/common/dimension.instance.json +239 -495
- package/common/dimension.js +51 -9
- package/common/drone.instance.json +395 -84
- package/common/drone.js +43 -50
- package/common/drone_v1.instance.json +36 -12
- package/common/drone_v1.js +14 -9
- package/common/edible.instance.json +96 -32
- package/common/emotions.instance.json +15 -1
- package/common/evaluate.js +10 -13
- package/common/fastfood.instance.json +282 -100
- package/common/fastfood.js +30 -15
- package/common/formulas.instance.json +162 -24
- package/common/formulas.js +18 -9
- package/common/gdefaults.js +20 -96
- package/common/helpers/concept.js +2 -9
- package/common/helpers/conjunction.js +11 -1
- package/common/helpers/dialogues.js +48 -24
- package/common/helpers/gdefaults.js +15 -5
- package/common/helpers/properties.js +125 -326
- package/common/helpers.js +28 -58
- package/common/hierarchy.js +71 -41
- package/common/kirk.instance.json +3 -1
- package/common/latin.instance.json +10 -10
- package/common/latin.js +5 -5
- package/common/length.instance.json +247 -61
- package/common/math.instance.json +144 -5
- package/common/math.js +18 -5
- package/common/menus.instance.json +29 -11
- package/common/menus.js +8 -5
- package/common/meta.js +14 -13
- package/common/nameable.js +9 -5
- package/common/numbers.instance.json +5 -3
- package/common/numbers.js +28 -28
- package/common/ordering.instance.json +53 -4
- package/common/ordinals.js +25 -25
- package/common/people.instance.json +66 -12
- package/common/percentages.js +4 -2
- package/common/pipboy.instance.json +89 -44
- package/common/pipboy.js +21 -14
- package/common/pokemon.instance.json +39 -13
- package/common/pressure.instance.json +14 -6
- package/common/properties.instance.json +2370 -511
- package/common/properties.js +496 -78
- package/common/punctuation.js +1 -0
- package/common/rates.instance.json +2 -2
- package/common/rates.js +3 -3
- package/common/reminders.instance.json +16 -0
- package/common/reminders.js +24 -20
- package/common/reports.instance.json +11 -12
- package/common/reports.js +12 -12
- package/common/scorekeeper.js +20 -10
- package/common/sdefaults.js +30 -9
- package/common/spock.instance.json +3 -1
- package/common/stm.js +16 -21
- package/common/temperature.instance.json +19 -11
- package/common/testing.js +2 -2
- package/common/time.instance.json +104 -47
- package/common/time.js +9 -8
- package/common/ui.instance.json +4 -2
- package/common/ui.js +5 -5
- package/common/weight.instance.json +86 -21
- package/common/weight.js +5 -1
- package/common/words.js +113 -2
- package/common/wp.instance.json +125 -18
- package/common/wp.js +6 -2
- package/main.js +2 -0
- package/package.json +7 -3
package/common/dialogues.js
CHANGED
|
@@ -10,10 +10,10 @@ const negation = require('./negation.js')
|
|
|
10
10
|
const punctuation = require('./punctuation.js')
|
|
11
11
|
const stm = require('./stm.js')
|
|
12
12
|
const _ = require('lodash')
|
|
13
|
-
const { API } = require('./helpers/dialogues')
|
|
13
|
+
const { API, focus } = require('./helpers/dialogues')
|
|
14
14
|
const { isMany, propertyToArray, words } = require('./helpers')
|
|
15
15
|
const dialogues_tests = require('./dialogues.test.json')
|
|
16
|
-
const { defaultObjectCheck, defaultContextCheck, indent
|
|
16
|
+
const { defaultObjectCheck, defaultContextCheck, indent } = require('./helpers')
|
|
17
17
|
const pluralize = require('pluralize')
|
|
18
18
|
|
|
19
19
|
function warningIsANotImplemented(log, context) {
|
|
@@ -57,6 +57,7 @@ const config = {
|
|
|
57
57
|
|
|
58
58
|
"(<what> ([whatAble|]))",
|
|
59
59
|
"([what:optional])",
|
|
60
|
+
"([who])",
|
|
60
61
|
|
|
61
62
|
"([be] ([briefOrWordy|]))",
|
|
62
63
|
|
|
@@ -71,7 +72,6 @@ const config = {
|
|
|
71
72
|
//"arm them, what, the phasers"
|
|
72
73
|
//greg is a first name
|
|
73
74
|
"([yesno|])",
|
|
74
|
-
{ pattern: "([debug23])" },
|
|
75
75
|
|
|
76
76
|
"([to] ([toAble|]))",
|
|
77
77
|
],
|
|
@@ -111,6 +111,7 @@ const config = {
|
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
113
|
id: 'makeObject',
|
|
114
|
+
where: where(),
|
|
114
115
|
bridge: "{ ...next(operator), object: after[0] }",
|
|
115
116
|
enhanced_associations: false,
|
|
116
117
|
generatorp: async ({context, gp}) => `${context.word} ${await gp(context.object)}`,
|
|
@@ -120,6 +121,7 @@ const config = {
|
|
|
120
121
|
},
|
|
121
122
|
{
|
|
122
123
|
id: 'setIdSuffix',
|
|
124
|
+
where: where(),
|
|
123
125
|
enhanced_associations: false,
|
|
124
126
|
bridge: "{ ...next(operator), suffix: after[0] }",
|
|
125
127
|
generatorp: async ({context, gp}) => `${context.word} ${await gp(context.suffix)}`,
|
|
@@ -129,6 +131,7 @@ const config = {
|
|
|
129
131
|
},
|
|
130
132
|
{
|
|
131
133
|
id: 'resetIdSuffix',
|
|
134
|
+
where: where(),
|
|
132
135
|
semantic: ({context, api}) => {
|
|
133
136
|
api.setIdSuffix('')
|
|
134
137
|
}
|
|
@@ -141,15 +144,20 @@ const config = {
|
|
|
141
144
|
optional: { 1: "{ marker: 'unknown', implicit: true, concept: true }", },
|
|
142
145
|
},
|
|
143
146
|
|
|
144
|
-
{ id: "debug23" },
|
|
145
147
|
{
|
|
146
148
|
id: "what",
|
|
147
|
-
|
|
148
|
-
|
|
149
|
+
isA: ['queryable'],
|
|
150
|
+
optional: "{ ...next(operator), query: ['what'], determined: true, isVariable: true }",
|
|
151
|
+
bridge: "{ ...after, query: ['what'], modifiers: ['what'], what: operator, isVariable: true }"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
id: "who",
|
|
155
|
+
isA: ['queryable'],
|
|
156
|
+
initial: { query: true, isVariable: true },
|
|
149
157
|
},
|
|
150
158
|
{ id: "whatAble" },
|
|
151
159
|
|
|
152
|
-
// context.
|
|
160
|
+
// context.isInstance == variables.isInstance (unification)
|
|
153
161
|
{
|
|
154
162
|
where: where(),
|
|
155
163
|
id: "to",
|
|
@@ -227,7 +235,8 @@ const config = {
|
|
|
227
235
|
words: {
|
|
228
236
|
"literals": {
|
|
229
237
|
"?": [{"id": "questionMark", "initial": "{}" }],
|
|
230
|
-
|
|
238
|
+
// TODO make who its own concept
|
|
239
|
+
// "who": [{"id": "what", "initial": "{ modifiers: [], query: true }" }],
|
|
231
240
|
"yes": [{"id": "yesno", "initial": "{ value: true }" }],
|
|
232
241
|
"no": [{"id": "yesno", "initial": "{ value: false }" }],
|
|
233
242
|
"brief": [{"id": "briefOrWordy", "initial": "{ value: 'brief' }" }],
|
|
@@ -267,7 +276,6 @@ const config = {
|
|
|
267
276
|
['the', 'article'],
|
|
268
277
|
['theAble', 'queryable'],
|
|
269
278
|
['it', 'queryable'],
|
|
270
|
-
['what', 'queryable'],
|
|
271
279
|
['whatAble', 'queryable'],
|
|
272
280
|
['negatable', 'queryable'],
|
|
273
281
|
['is', 'canBeQuestion'],
|
|
@@ -282,12 +290,13 @@ const config = {
|
|
|
282
290
|
{
|
|
283
291
|
where: where(),
|
|
284
292
|
notes: "handle making responses brief",
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
293
|
+
// TODO make this use callOnce
|
|
294
|
+
match: ({context, objects, callId}) => (context.topLevel || context.isResponse) && objects.brief && !context.briefWasRun && !context.paraphrase,
|
|
295
|
+
apply: async ({context, g, toEValue}) => {
|
|
296
|
+
const focussed = focus(toEValue(context))
|
|
297
|
+
focussed.briefWasRun = true
|
|
289
298
|
const result = await g(focussed)
|
|
290
|
-
|
|
299
|
+
focussed.briefWasRun = false
|
|
291
300
|
return result
|
|
292
301
|
},
|
|
293
302
|
priority: -2,
|
|
@@ -301,13 +310,13 @@ const config = {
|
|
|
301
310
|
{
|
|
302
311
|
where: where(),
|
|
303
312
|
notes: "unknown answer default response",
|
|
304
|
-
match: ({context, namespaced}) => context.marker
|
|
313
|
+
match: ({context, namespaced}) => context.marker === 'undefined' && context.brief,
|
|
305
314
|
apply: ({context}) => `not known`,
|
|
306
315
|
},
|
|
307
316
|
{
|
|
308
317
|
where: where(),
|
|
309
318
|
notes: "unknown answer default response",
|
|
310
|
-
match: ({context}) => context.marker
|
|
319
|
+
match: ({context}) => context.marker === 'undefined',
|
|
311
320
|
apply: ({context}) => `that is not known`,
|
|
312
321
|
},
|
|
313
322
|
{
|
|
@@ -405,7 +414,9 @@ const config = {
|
|
|
405
414
|
},
|
|
406
415
|
{
|
|
407
416
|
where: where(),
|
|
408
|
-
match: ({context, hierarchy}) =>
|
|
417
|
+
match: ({context, hierarchy, debug}) => {
|
|
418
|
+
return hierarchy.isA(context.marker, 'canBeQuestion') && context.paraphrase && context.topLevel && context.query
|
|
419
|
+
},
|
|
409
420
|
apply: async ({context, gp}) => {
|
|
410
421
|
return `${await gp({...context, topLevel: undefined})}?`
|
|
411
422
|
},
|
|
@@ -422,15 +433,16 @@ const config = {
|
|
|
422
433
|
{
|
|
423
434
|
where: where(),
|
|
424
435
|
notes: 'is with a response defined',
|
|
425
|
-
|
|
426
|
-
|
|
436
|
+
// TODO change concept to be isConcept for the boolean case to avoid this confusion
|
|
437
|
+
match: ({context, hierarchy}) => hierarchy.isA(context.marker, 'is') && context.evalue && typeof context.evalue.concept !== 'boolean',
|
|
438
|
+
apply: async ({context, debug, g, gs}) => {
|
|
427
439
|
const response = context.evalue;
|
|
428
440
|
const concept = response.concept;
|
|
429
441
|
if (concept) {
|
|
430
442
|
concept.paraphrase = true
|
|
431
443
|
concept.isSelf = true
|
|
432
|
-
const
|
|
433
|
-
return `${await g(concept)} ${context.word} ${
|
|
444
|
+
const isInstance = await g(response.isInstance)
|
|
445
|
+
return `${await g(concept)} ${context.word} ${isInstance}`
|
|
434
446
|
} else {
|
|
435
447
|
if (Array.isArray(response)) {
|
|
436
448
|
return `${await gs(response)}`
|
|
@@ -444,8 +456,8 @@ const config = {
|
|
|
444
456
|
where: where(),
|
|
445
457
|
notes: 'x is y',
|
|
446
458
|
match: ({context, hierarchy}) => hierarchy.isA(context.marker, 'is') && !context.evalue,
|
|
447
|
-
apply: async ({context, g, gp, debug, gr, callId}) => {
|
|
448
|
-
if ((context.two.evalue || {}).marker
|
|
459
|
+
apply: async ({isA, context, g, gp, debug, gr, callId}) => {
|
|
460
|
+
if ((context.two.evalue || {}).marker === 'undefined') {
|
|
449
461
|
return await g(context.two.evalue)
|
|
450
462
|
}
|
|
451
463
|
|
|
@@ -453,8 +465,8 @@ const config = {
|
|
|
453
465
|
return `${await gp(context.one)} ${isMany(context.one) || isMany(context.two) || isMany(context) ? "are" : "is"} ${await g(context.two)}`
|
|
454
466
|
}
|
|
455
467
|
|
|
456
|
-
if (context.
|
|
457
|
-
context = context.
|
|
468
|
+
if (context.evalue) {
|
|
469
|
+
context = context.evalue
|
|
458
470
|
}
|
|
459
471
|
|
|
460
472
|
function hasFocus(property) {
|
|
@@ -477,6 +489,17 @@ const config = {
|
|
|
477
489
|
} else {
|
|
478
490
|
focus = 'one'
|
|
479
491
|
}
|
|
492
|
+
const other = focus == 'one' ? 'two' : 'one'
|
|
493
|
+
if (!isMany(context[focus]) && isMany(context[other])) {
|
|
494
|
+
focus = other
|
|
495
|
+
}
|
|
496
|
+
// idiom: dont say the name is it. say it is the name
|
|
497
|
+
if (focus == 'one' && isA(context[focus], 'thisitthat')) {
|
|
498
|
+
focus = other
|
|
499
|
+
}
|
|
500
|
+
if (focus == 'two' && context[other].isPropertyValue) {
|
|
501
|
+
focus = other
|
|
502
|
+
}
|
|
480
503
|
// greg101
|
|
481
504
|
if (focus == 'one') {
|
|
482
505
|
let number = 'one'
|
|
@@ -487,7 +510,7 @@ const config = {
|
|
|
487
510
|
} else {
|
|
488
511
|
// TODO fix this using the assumed and that whole mess. change isResponse to useValue
|
|
489
512
|
if (context.isResponse) {
|
|
490
|
-
return `${await gp(context.one, { assumed: { responding: true } })} ${isMany(context.one)
|
|
513
|
+
return `${await gp(context.one, { assumed: { responding: true } })} ${isMany(context.one) ? "are" : "is"} ${await g(context.two)}`
|
|
491
514
|
} else {
|
|
492
515
|
return `${await gp(context.one)} ${isMany(context.one) || isMany(context.two) || isMany(context) ? "are" : "is"} ${await gr(context.two)}`
|
|
493
516
|
}
|
|
@@ -499,12 +522,14 @@ const config = {
|
|
|
499
522
|
semantics: [
|
|
500
523
|
{
|
|
501
524
|
where: where(),
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
apply: ({context, hierarchy}) => {
|
|
505
|
-
debugger // eslint-disable-line no-debugger
|
|
506
|
-
debugger // eslint-disable-line no-debugger
|
|
525
|
+
match: ({context}) => {
|
|
526
|
+
return context.marker == 'unify' && context.terms.some((term) => ['what', 'who'].includes(term.marker))
|
|
507
527
|
},
|
|
528
|
+
apply: async ({context, resolveEvaluate, e, toFinalValue}) => {
|
|
529
|
+
const value = context.terms.find((term) => !['what', 'who'].includes(term.marker))
|
|
530
|
+
instance = await e(value, where())
|
|
531
|
+
await resolveEvaluate(context, instance)
|
|
532
|
+
}
|
|
508
533
|
},
|
|
509
534
|
{
|
|
510
535
|
where: where(),
|
|
@@ -518,9 +543,10 @@ const config = {
|
|
|
518
543
|
where: where(),
|
|
519
544
|
match: ({context}) => context.marker === 'error',
|
|
520
545
|
apply: async ({context, g, gp}) => {
|
|
521
|
-
context.evalue = "That is not known"
|
|
522
546
|
if (context.reason) {
|
|
523
|
-
context.evalue
|
|
547
|
+
context.evalue = `${await g(context.reason)}`
|
|
548
|
+
} else {
|
|
549
|
+
context.evalue = "That is not known"
|
|
524
550
|
}
|
|
525
551
|
context.isResponse = true
|
|
526
552
|
}
|
|
@@ -534,52 +560,83 @@ const config = {
|
|
|
534
560
|
object is a type (is greg a human) // handled by queryBridge
|
|
535
561
|
*/
|
|
536
562
|
|
|
563
|
+
/*
|
|
564
|
+
what is the age of bob
|
|
565
|
+
the age of who is 30 years old
|
|
566
|
+
|
|
567
|
+
both are the sameA
|
|
568
|
+
|
|
569
|
+
|
|
570
|
+
what == the age
|
|
571
|
+
the age == 30 years old
|
|
572
|
+
|
|
573
|
+
|
|
574
|
+
resolve "the age of bob" + "30 years old"
|
|
575
|
+
|
|
576
|
+
what == "the age of bob" -> then resolve "the age of bob"
|
|
577
|
+
the age of who is 30 years old -> 30 years (age) of who
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
|
|
581
|
+
a b
|
|
582
|
+
one side is query so resolve the other one
|
|
583
|
+
a = "what" | "the age of who"
|
|
584
|
+
b = "the age of bob" | 30 years old
|
|
585
|
+
replace the main
|
|
586
|
+
"the age of bob" | 30 years old is who
|
|
587
|
+
resolve
|
|
588
|
+
30 years old | bob
|
|
589
|
+
*/
|
|
537
590
|
match: ({context, hierarchy}) => hierarchy.isA(context.marker, 'is') && context.query,
|
|
538
|
-
apply: async ({context, s, log, km, objects, e}) => {
|
|
591
|
+
apply: async ({context, s, log, km, objects, e, toEValue}) => {
|
|
539
592
|
const one = context.one;
|
|
540
593
|
const two = context.two;
|
|
541
|
-
|
|
594
|
+
|
|
595
|
+
let query, value;
|
|
542
596
|
if (one.query) {
|
|
543
|
-
|
|
597
|
+
query = one;
|
|
544
598
|
value = two;
|
|
545
599
|
} else {
|
|
546
|
-
|
|
600
|
+
query = two;
|
|
547
601
|
value = one;
|
|
548
602
|
}
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
603
|
+
|
|
604
|
+
const unification = await e({
|
|
605
|
+
marker: 'unify',
|
|
606
|
+
terms: [query, value],
|
|
607
|
+
}, where())
|
|
608
|
+
instance = unification.evalue || { marker: 'undefined' }
|
|
609
|
+
|
|
556
610
|
if (instance.verbatim) {
|
|
557
611
|
context.evalue = { verbatim: instance.verbatim }
|
|
558
612
|
context.isResponse = true
|
|
559
613
|
return
|
|
560
614
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
615
|
+
|
|
616
|
+
if (toEValue(instance)?.marker === 'undefined') {
|
|
617
|
+
context.evalue = instance
|
|
618
|
+
context.isResponse = true
|
|
619
|
+
return
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
const concept = _.cloneDeep(value)
|
|
564
623
|
concept.isQuery = undefined
|
|
565
|
-
// greg101
|
|
566
|
-
// instance.focusableForPhrase = true
|
|
567
624
|
instance.focus = true
|
|
568
625
|
if (concept.hierarchy) {
|
|
569
626
|
concept.focusableForPhrase = true
|
|
570
627
|
}
|
|
571
|
-
// concept.focus = true
|
|
572
628
|
|
|
573
629
|
const many = isMany(concept) || isMany(instance)
|
|
574
630
|
const evalue = {
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
631
|
+
default: true,
|
|
632
|
+
marker: "is",
|
|
633
|
+
one: concept,
|
|
634
|
+
two: instance,
|
|
635
|
+
focusable: ['two', 'one'],
|
|
636
|
+
word: many ? "are" : "is",
|
|
637
|
+
number: many ? "many" : undefined,
|
|
582
638
|
}
|
|
639
|
+
|
|
583
640
|
context.evalue = evalue
|
|
584
641
|
context.isResponse = true
|
|
585
642
|
}
|
|
@@ -613,7 +670,7 @@ const config = {
|
|
|
613
670
|
where: where(),
|
|
614
671
|
notes: 'x is y. handles x is a kind of y or x = y in the stm',
|
|
615
672
|
match: ({context}) => context.marker == 'is' && !context.query && context.one && context.two,
|
|
616
|
-
apply: async ({_continue, context,
|
|
673
|
+
apply: async ({_continue, context, e, debug, log, api, kms, config}) => {
|
|
617
674
|
function warningSameNotEvaluated(log, one) {
|
|
618
675
|
const description = 'WARNING from Dialogues KM: For the "X is Y" type phrase implement a same handler.'
|
|
619
676
|
const match = `({context}) => context.marker == '${one.marker}' && context.same && <other conditions as you like>`
|
|
@@ -625,8 +682,7 @@ const config = {
|
|
|
625
682
|
|
|
626
683
|
const one = context.one;
|
|
627
684
|
const two = context.two;
|
|
628
|
-
|
|
629
|
-
const onePrime = await s(one)
|
|
685
|
+
const onePrime = await e({ marker: 'same', one: one, two: two }, where())
|
|
630
686
|
if (!onePrime.sameWasProcessed) {
|
|
631
687
|
warningSameNotEvaluated(log, one)
|
|
632
688
|
} else {
|
|
@@ -635,7 +691,6 @@ const config = {
|
|
|
635
691
|
context.isResponse = true
|
|
636
692
|
}
|
|
637
693
|
}
|
|
638
|
-
one.same = undefined
|
|
639
694
|
if (!onePrime.sameWasProcessed) {
|
|
640
695
|
_continue()
|
|
641
696
|
}
|
|
@@ -659,14 +714,13 @@ const config = {
|
|
|
659
714
|
{
|
|
660
715
|
where: where(),
|
|
661
716
|
notes: 'get variable from stm',
|
|
662
|
-
match: ({context, kms}) =>
|
|
663
|
-
// match: ({context, kms}) => context.evaluate,
|
|
717
|
+
match: ({context, kms}) => kms.stm.api.getVariable(context),
|
|
664
718
|
priority: -1,
|
|
665
719
|
apply: async ({context, kms, e}) => {
|
|
666
720
|
const api = kms.stm.api
|
|
667
721
|
context.value = api.getVariable(context)
|
|
668
722
|
if (context.value && context.value.marker) {
|
|
669
|
-
context.evalue = await e(context.value)
|
|
723
|
+
context.evalue = await e(context.value, where())
|
|
670
724
|
}
|
|
671
725
|
context.focusableForPhrase = true
|
|
672
726
|
}
|
|
@@ -675,12 +729,7 @@ const config = {
|
|
|
675
729
|
};
|
|
676
730
|
|
|
677
731
|
function initializer({objects, config, isModule}) {
|
|
678
|
-
|
|
679
|
-
config.addArgs((args) => ({
|
|
680
|
-
e: (context) => config.api.getEvaluator(args.s, args.log, context),
|
|
681
|
-
}))
|
|
682
|
-
*/
|
|
683
|
-
config.addArgs(({config, api, isA}) => ({
|
|
732
|
+
config.addArgs(({config, api, isA, e}) => ({
|
|
684
733
|
toScopedId: (context) => {
|
|
685
734
|
return api('dialogues').toScopedId(context)
|
|
686
735
|
},
|
|
@@ -690,6 +739,13 @@ function initializer({objects, config, isModule}) {
|
|
|
690
739
|
}
|
|
691
740
|
},
|
|
692
741
|
values: propertyToArray,
|
|
742
|
+
unify: async (term1, term2) => {
|
|
743
|
+
const unification = await e({
|
|
744
|
+
marker: 'unify',
|
|
745
|
+
terms: [term1, term2],
|
|
746
|
+
}, where())
|
|
747
|
+
return unification?.evalue
|
|
748
|
+
}
|
|
693
749
|
}))
|
|
694
750
|
objects.mentioned = []
|
|
695
751
|
objects.variables = {
|