tpmkms_4wp 9.8.0-beta.1 → 9.8.0-beta.15
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 +4 -4
- package/common/actions.js +12 -10
- package/common/askfor.instance.json +12 -184
- package/common/askfor.js +20 -12
- package/common/asking.js +9 -4
- package/common/avatar.js +1 -1
- package/common/can.instance.json +2 -18
- package/common/can.js +2 -2
- package/common/comparable.instance.json +6 -12
- package/common/concept.instance.json +8 -4
- package/common/concept.js +2 -0
- package/common/conjunction.js +6 -4
- package/common/control.js +2 -2
- package/common/countable.js +1 -0
- package/common/dateTimeSelectors.instance.json +4 -4
- package/common/dateTimeSelectors.js +4 -7
- package/common/dates.instance.json +11 -1
- package/common/dates.js +6 -1
- package/common/debug.instance.json +5 -1
- package/common/debug.js +2 -0
- package/common/dialogues.js +44 -41
- package/common/dimension.instance.json +17 -443
- package/common/dimension.js +13 -12
- package/common/drone.instance.json +49 -25
- package/common/drone.js +41 -30
- package/common/drone_v1.instance.json +13 -3
- package/common/drone_v1.js +9 -4
- package/common/evaluate.js +7 -13
- package/common/fastfood.instance.json +12 -4
- package/common/fastfood.js +15 -9
- package/common/formulas.instance.json +5 -5
- package/common/formulas.js +7 -7
- package/common/gdefaults.js +5 -74
- package/common/helpers/dialogues.js +1 -10
- package/common/helpers/properties.js +6 -10
- package/common/helpers.js +5 -1
- package/common/hierarchy.js +9 -8
- package/common/math.instance.json +13 -4
- package/common/math.js +13 -3
- package/common/menus.instance.json +6 -2
- package/common/menus.js +5 -2
- package/common/meta.js +14 -13
- package/common/nameable.js +5 -3
- package/common/ordering.instance.json +1 -2
- package/common/ordinals.js +1 -1
- package/common/percentages.js +4 -2
- package/common/pipboy.instance.json +38 -27
- package/common/pipboy.js +21 -14
- package/common/properties.instance.json +2327 -568
- package/common/properties.js +161 -57
- 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 +10 -7
- package/common/reports.instance.json +4 -6
- package/common/reports.js +12 -12
- package/common/scorekeeper.js +6 -6
- package/common/sdefaults.js +11 -9
- package/common/stm.js +16 -21
- package/common/testing.js +2 -2
- package/common/time.instance.json +5 -8
- package/common/time.js +7 -7
- package/common/ui.js +5 -5
- package/common/words.js +106 -1
- package/common/wp.instance.json +11 -4
- package/common/wp.js +6 -2
- package/package.json +2 -2
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"action": "(@<= 'action' || @<= 'doAction')"
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
|
-
"semantic": "async ({context, fragments, e,
|
|
49
|
+
"semantic": "async ({context, fragments, e, toFinalValue, kms}) => {\n const instantiation = await fragments(\"quantity in milliseconds\", { quantity: context.delayTime })\n const result = await e(instantiation, where())\n const milliseconds = toFinalValue(toFinalValue(result).amount)\n await kms.time.api.sleep(milliseconds)\n await e(context.action, where())\n }"
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
"where": "/home/dev/code/theprogrammablemind/kms/common/actions.js:62",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"action"
|
|
143
143
|
]
|
|
144
144
|
],
|
|
145
|
-
"semantic": "async ({context, toArray,
|
|
145
|
+
"semantic": "async ({context, toArray, e}) => {\n for (const action of toArray(context.action)) {\n await e(action, where())\n }\n }"
|
|
146
146
|
}
|
|
147
147
|
],
|
|
148
148
|
"words": {
|
|
@@ -166,8 +166,8 @@
|
|
|
166
166
|
},
|
|
167
167
|
"semantics": [
|
|
168
168
|
{
|
|
169
|
-
"match": "({context, isA, stack, namespaced}) => !context.pullFromContext && !
|
|
170
|
-
"apply": "async ({context, _continue, testLog,
|
|
169
|
+
"match": "({context, isA, contextHierarchy, stack, namespaced}) => {\n return !context.pullFromContext && !contextHierarchy.under('call') && (isA(context.marker, 'action') || isA(context.marker, 'doAction')) && !namespaced.get('actions', context, 'logged')\n }",
|
|
170
|
+
"apply": "async ({context, _continue, testLog, gp, remember}) => {\n remember(context)\n await testLog(() => gp(context))\n _continue()\n }"
|
|
171
171
|
}
|
|
172
172
|
]
|
|
173
173
|
}
|
package/common/actions.js
CHANGED
|
@@ -50,12 +50,12 @@ const config = {
|
|
|
50
50
|
action: "(@<= 'action' || @<= 'doAction')",
|
|
51
51
|
},
|
|
52
52
|
},
|
|
53
|
-
semantic: async ({context, fragments, e,
|
|
53
|
+
semantic: async ({context, fragments, e, toFinalValue, kms}) => {
|
|
54
54
|
const instantiation = await fragments("quantity in milliseconds", { quantity: context.delayTime })
|
|
55
|
-
const result = await e(instantiation)
|
|
55
|
+
const result = await e(instantiation, where())
|
|
56
56
|
const milliseconds = toFinalValue(toFinalValue(result).amount)
|
|
57
57
|
await kms.time.api.sleep(milliseconds)
|
|
58
|
-
await
|
|
58
|
+
await e(context.action, where())
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
{
|
|
@@ -98,9 +98,9 @@ const config = {
|
|
|
98
98
|
bridge: "{ ...next(operator), value: append(before, operator.value) }",
|
|
99
99
|
semantic: {
|
|
100
100
|
match: ({context}) => context.isList,
|
|
101
|
-
apply: async ({context, toArray,
|
|
101
|
+
apply: async ({context, toArray, e}) => {
|
|
102
102
|
for (const action of toArray(context)) {
|
|
103
|
-
await
|
|
103
|
+
await e(action, where())
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
}
|
|
@@ -131,9 +131,9 @@ const config = {
|
|
|
131
131
|
}`,
|
|
132
132
|
localHierarchy: [['thisitthat', 'action']],
|
|
133
133
|
where: where(),
|
|
134
|
-
semantic: async ({context, toArray,
|
|
134
|
+
semantic: async ({context, toArray, e}) => {
|
|
135
135
|
for (const action of toArray(context.action)) {
|
|
136
|
-
await
|
|
136
|
+
await e(action, where())
|
|
137
137
|
}
|
|
138
138
|
},
|
|
139
139
|
},
|
|
@@ -147,10 +147,12 @@ const config = {
|
|
|
147
147
|
{
|
|
148
148
|
where: where(),
|
|
149
149
|
priority: -1,
|
|
150
|
-
match: ({context, isA, stack, namespaced}) =>
|
|
151
|
-
|
|
150
|
+
match: ({context, isA, contextHierarchy, stack, namespaced}) => {
|
|
151
|
+
return !context.pullFromContext && !contextHierarchy.under('call') && (isA(context.marker, 'action') || isA(context.marker, 'doAction')) && !namespaced.get('actions', context, 'logged')
|
|
152
|
+
},
|
|
153
|
+
apply: async ({context, _continue, testLog, gp, remember}) => {
|
|
152
154
|
remember(context)
|
|
153
|
-
await testLog(() =>
|
|
155
|
+
await testLog(() => gp(context))
|
|
154
156
|
_continue()
|
|
155
157
|
}
|
|
156
158
|
},
|
|
@@ -30,17 +30,19 @@
|
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"id": "known",
|
|
33
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/askfor.js:77",
|
|
33
34
|
"isA": [
|
|
34
35
|
"queryable"
|
|
35
36
|
],
|
|
36
|
-
"
|
|
37
|
+
"semantic": "async ({kms, context, e, callId, toList, flatten, toEValue, resolveEvaluate, objects}) => {\n const known = await kms.properties.api.getProperty(context.subjects[0], 'property')\n resolveEvaluate(context, known)\n }"
|
|
37
38
|
},
|
|
38
39
|
{
|
|
39
40
|
"id": "information",
|
|
41
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/askfor.js:86",
|
|
40
42
|
"isA": [
|
|
41
43
|
"noun"
|
|
42
44
|
],
|
|
43
|
-
"
|
|
45
|
+
"semantic": "async ({context, e, callId, toList, flatten, toEValue, resolveEvaluate, objects}) => {\n const properties = objects.askFor\n const values = []\n for (const property of properties) {\n try {\n const value = (await e(property, where())).evalue\n values.push({ marker: 'labelledValue', label: property, value })\n } catch( e ) {\n }\n }\n resolveEvaluate(context, toList(values))\n }"
|
|
44
46
|
},
|
|
45
47
|
{
|
|
46
48
|
"id": "for_askfor",
|
|
@@ -57,6 +59,7 @@
|
|
|
57
59
|
},
|
|
58
60
|
{
|
|
59
61
|
"id": "askfor_askfor",
|
|
62
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/askfor.js:114",
|
|
60
63
|
"isA": [
|
|
61
64
|
"verb"
|
|
62
65
|
],
|
|
@@ -64,7 +67,7 @@
|
|
|
64
67
|
"ask"
|
|
65
68
|
],
|
|
66
69
|
"bridge": "{\n ...next(operator),\n properties: after[0],\n interpolate: [{ self: true }, { property: 'properties' }]\n }",
|
|
67
|
-
"semantic": "async ({e,
|
|
70
|
+
"semantic": "async ({e, gp, objects, flatten, context, ask, fragments, toEValue}) => {\n const argument = context.properties.argument\n const getValue = (property) => async (args) => {\n try {\n const value = toEValue(await e(property, where()))\n if (value.marker === 'undefined') {\n return\n }\n return value\n } catch (e) {\n }\n }\n\n const setValue = (property) => async ({ context, namespaced, tag }) => {\n const is = { marker: 'is', one: property, two: context }\n namespaced.set('dialogs', is, 'allowHierarchy', false)\n await e(is, where())\n }\n\n const properties = flattenInPlace(argument)\n counter = 0\n for (const property of properties.reverse()) {\n counter += 1\n const query = memoizeAsync(async () => await(gp(await fragments(\"what is the concept?\", { concept: property }))))\n const compatible_types = property.compatible_types || [property.marker]\n const matchr = ({context, isA}) => {\n return !context.same && isA(context, compatible_types)\n }\n objects.askFor.push(property);\n askForProperty({\n ask,\n tag: `ask#${counter}`,\n getValue: getValue(property),\n setValue: setValue(property),\n query,\n matchr,\n })\n }\n }"
|
|
68
71
|
}
|
|
69
72
|
]
|
|
70
73
|
},
|
|
@@ -440,189 +443,11 @@
|
|
|
440
443
|
],
|
|
441
444
|
"level": 2,
|
|
442
445
|
"context_index": 1,
|
|
443
|
-
"topLevel": true
|
|
444
|
-
"evalue": {
|
|
445
|
-
"default": true,
|
|
446
|
-
"marker": "is",
|
|
447
|
-
"one": {
|
|
448
|
-
"marker": "concept",
|
|
449
|
-
"value": "concept",
|
|
450
|
-
"default": true,
|
|
451
|
-
"text": "the concept",
|
|
452
|
-
"dead": true,
|
|
453
|
-
"word": "concept",
|
|
454
|
-
"range": {
|
|
455
|
-
"start": 8,
|
|
456
|
-
"end": 18
|
|
457
|
-
},
|
|
458
|
-
"types": [
|
|
459
|
-
"concept"
|
|
460
|
-
],
|
|
461
|
-
"focusableForPhrase": true,
|
|
462
|
-
"pullFromContext": true,
|
|
463
|
-
"concept": true,
|
|
464
|
-
"wantsValue": true,
|
|
465
|
-
"checks": [
|
|
466
|
-
"determiner"
|
|
467
|
-
],
|
|
468
|
-
"determiner": {
|
|
469
|
-
"modifiers": [],
|
|
470
|
-
"text": "the",
|
|
471
|
-
"marker": "the",
|
|
472
|
-
"word": "the",
|
|
473
|
-
"range": {
|
|
474
|
-
"start": 8,
|
|
475
|
-
"end": 10
|
|
476
|
-
},
|
|
477
|
-
"level": 0
|
|
478
|
-
},
|
|
479
|
-
"theable": {
|
|
480
|
-
"marker": "concept",
|
|
481
|
-
"value": "concept",
|
|
482
|
-
"default": true,
|
|
483
|
-
"text": "concept",
|
|
484
|
-
"dead": true,
|
|
485
|
-
"word": "concept",
|
|
486
|
-
"range": {
|
|
487
|
-
"start": 12,
|
|
488
|
-
"end": 18
|
|
489
|
-
},
|
|
490
|
-
"types": [
|
|
491
|
-
"concept"
|
|
492
|
-
],
|
|
493
|
-
"level": 0
|
|
494
|
-
},
|
|
495
|
-
"flattenInPlace": [
|
|
496
|
-
[
|
|
497
|
-
"value",
|
|
498
|
-
"theable"
|
|
499
|
-
]
|
|
500
|
-
],
|
|
501
|
-
"flatten_ignore": [
|
|
502
|
-
"theable"
|
|
503
|
-
],
|
|
504
|
-
"interpolate": [
|
|
505
|
-
{
|
|
506
|
-
"property": "determiner"
|
|
507
|
-
},
|
|
508
|
-
{
|
|
509
|
-
"property": "theable"
|
|
510
|
-
}
|
|
511
|
-
],
|
|
512
|
-
"level": 0
|
|
513
|
-
},
|
|
514
|
-
"two": {
|
|
515
|
-
"marker": "concept",
|
|
516
|
-
"value": {
|
|
517
|
-
"marker": "surname",
|
|
518
|
-
"isVariable": true,
|
|
519
|
-
"evaluate": false,
|
|
520
|
-
"pullFromContext": false,
|
|
521
|
-
"value": "last_name",
|
|
522
|
-
"fromSTM": true,
|
|
523
|
-
"namespaced": {
|
|
524
|
-
"stm": {
|
|
525
|
-
"id": 1
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
},
|
|
529
|
-
"default": true,
|
|
530
|
-
"text": "the concept",
|
|
531
|
-
"dead": true,
|
|
532
|
-
"word": "concept",
|
|
533
|
-
"range": {
|
|
534
|
-
"start": 8,
|
|
535
|
-
"end": 18
|
|
536
|
-
},
|
|
537
|
-
"types": [
|
|
538
|
-
"concept"
|
|
539
|
-
],
|
|
540
|
-
"focusableForPhrase": true,
|
|
541
|
-
"pullFromContext": true,
|
|
542
|
-
"concept": true,
|
|
543
|
-
"wantsValue": true,
|
|
544
|
-
"checks": [
|
|
545
|
-
"determiner"
|
|
546
|
-
],
|
|
547
|
-
"determiner": {
|
|
548
|
-
"modifiers": [],
|
|
549
|
-
"text": "the",
|
|
550
|
-
"marker": "the",
|
|
551
|
-
"word": "the",
|
|
552
|
-
"range": {
|
|
553
|
-
"start": 8,
|
|
554
|
-
"end": 10
|
|
555
|
-
},
|
|
556
|
-
"level": 0
|
|
557
|
-
},
|
|
558
|
-
"theable": {
|
|
559
|
-
"marker": "concept",
|
|
560
|
-
"value": "concept",
|
|
561
|
-
"default": true,
|
|
562
|
-
"text": "concept",
|
|
563
|
-
"dead": true,
|
|
564
|
-
"word": "concept",
|
|
565
|
-
"range": {
|
|
566
|
-
"start": 12,
|
|
567
|
-
"end": 18
|
|
568
|
-
},
|
|
569
|
-
"types": [
|
|
570
|
-
"concept"
|
|
571
|
-
],
|
|
572
|
-
"level": 0
|
|
573
|
-
},
|
|
574
|
-
"flattenInPlace": [
|
|
575
|
-
[
|
|
576
|
-
"value",
|
|
577
|
-
"theable"
|
|
578
|
-
]
|
|
579
|
-
],
|
|
580
|
-
"flatten_ignore": [
|
|
581
|
-
"theable"
|
|
582
|
-
],
|
|
583
|
-
"interpolate": [
|
|
584
|
-
{
|
|
585
|
-
"property": "determiner"
|
|
586
|
-
},
|
|
587
|
-
{
|
|
588
|
-
"property": "theable"
|
|
589
|
-
}
|
|
590
|
-
],
|
|
591
|
-
"level": 0,
|
|
592
|
-
"evalue": {
|
|
593
|
-
"marker": "surname",
|
|
594
|
-
"isVariable": true,
|
|
595
|
-
"evaluate": false,
|
|
596
|
-
"pullFromContext": false,
|
|
597
|
-
"value": "last_name",
|
|
598
|
-
"fromSTM": true,
|
|
599
|
-
"namespaced": {
|
|
600
|
-
"stm": {
|
|
601
|
-
"id": 1
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
},
|
|
605
|
-
"touchedBy": [
|
|
606
|
-
"askfor#call3",
|
|
607
|
-
"askfor#call2"
|
|
608
|
-
],
|
|
609
|
-
"instance": true,
|
|
610
|
-
"focus": true
|
|
611
|
-
},
|
|
612
|
-
"focusable": [
|
|
613
|
-
"two",
|
|
614
|
-
"one"
|
|
615
|
-
],
|
|
616
|
-
"word": "is"
|
|
617
|
-
},
|
|
618
|
-
"isResponse": true,
|
|
619
|
-
"touchedBy": [
|
|
620
|
-
"askfor#call2"
|
|
621
|
-
]
|
|
446
|
+
"topLevel": true
|
|
622
447
|
}
|
|
623
448
|
],
|
|
624
449
|
"generated": [
|
|
625
|
-
"
|
|
450
|
+
""
|
|
626
451
|
],
|
|
627
452
|
"paraphrases": [
|
|
628
453
|
"what is the concept?"
|
|
@@ -630,7 +455,7 @@
|
|
|
630
455
|
"paraphrasesParenthesized": [],
|
|
631
456
|
"generatedParenthesized": [],
|
|
632
457
|
"responses": [
|
|
633
|
-
"
|
|
458
|
+
""
|
|
634
459
|
],
|
|
635
460
|
"associations": [],
|
|
636
461
|
"summaries": [
|
|
@@ -893,12 +718,14 @@
|
|
|
893
718
|
},
|
|
894
719
|
{
|
|
895
720
|
"id": "known",
|
|
721
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/askfor.js:77",
|
|
896
722
|
"isA": [
|
|
897
723
|
"queryable"
|
|
898
724
|
]
|
|
899
725
|
},
|
|
900
726
|
{
|
|
901
727
|
"id": "information",
|
|
728
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/askfor.js:86",
|
|
902
729
|
"isA": [
|
|
903
730
|
"noun"
|
|
904
731
|
]
|
|
@@ -918,6 +745,7 @@
|
|
|
918
745
|
},
|
|
919
746
|
{
|
|
920
747
|
"id": "askfor_askfor",
|
|
748
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/askfor.js:114",
|
|
921
749
|
"isA": [
|
|
922
750
|
"verb"
|
|
923
751
|
],
|
package/common/askfor.js
CHANGED
|
@@ -74,22 +74,26 @@ const template = {
|
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
id: 'known',
|
|
77
|
+
where: where(),
|
|
77
78
|
isA: ['queryable'],
|
|
78
|
-
|
|
79
|
+
semantic: async ({kms, context, e, callId, toList, flatten, toEValue, resolveEvaluate, objects}) => {
|
|
79
80
|
const known = await kms.properties.api.getProperty(context.subjects[0], 'property')
|
|
80
81
|
resolveEvaluate(context, known)
|
|
81
82
|
},
|
|
82
83
|
},
|
|
83
84
|
{
|
|
84
85
|
id: 'information',
|
|
86
|
+
where: where(),
|
|
85
87
|
isA: ['noun'],
|
|
86
|
-
|
|
88
|
+
semantic: async ({context, e, callId, toList, flatten, toEValue, resolveEvaluate, objects}) => {
|
|
87
89
|
const properties = objects.askFor
|
|
88
90
|
const values = []
|
|
89
91
|
for (const property of properties) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
try {
|
|
93
|
+
const value = (await e(property, where())).evalue
|
|
94
|
+
values.push({ marker: 'labelledValue', label: property, value })
|
|
95
|
+
} catch( e ) {
|
|
96
|
+
}
|
|
93
97
|
}
|
|
94
98
|
resolveEvaluate(context, toList(values))
|
|
95
99
|
},
|
|
@@ -107,6 +111,7 @@ const template = {
|
|
|
107
111
|
},
|
|
108
112
|
{
|
|
109
113
|
id: 'askfor_askfor',
|
|
114
|
+
where: where(),
|
|
110
115
|
isA: ['verb'],
|
|
111
116
|
words: ['ask'],
|
|
112
117
|
bridge: `{
|
|
@@ -114,20 +119,23 @@ const template = {
|
|
|
114
119
|
properties: after[0],
|
|
115
120
|
interpolate: [{ self: true }, { property: 'properties' }]
|
|
116
121
|
}`,
|
|
117
|
-
semantic: async ({e,
|
|
122
|
+
semantic: async ({e, gp, objects, flatten, context, ask, fragments, toEValue}) => {
|
|
118
123
|
const argument = context.properties.argument
|
|
119
124
|
const getValue = (property) => async (args) => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
125
|
+
try {
|
|
126
|
+
const value = toEValue(await e(property, where()))
|
|
127
|
+
if (value.marker === 'undefined') {
|
|
128
|
+
return
|
|
129
|
+
}
|
|
130
|
+
return value
|
|
131
|
+
} catch (e) {
|
|
123
132
|
}
|
|
124
|
-
return value
|
|
125
133
|
}
|
|
126
134
|
|
|
127
135
|
const setValue = (property) => async ({ context, namespaced, tag }) => {
|
|
128
136
|
const is = { marker: 'is', one: property, two: context }
|
|
129
137
|
namespaced.set('dialogs', is, 'allowHierarchy', false)
|
|
130
|
-
await
|
|
138
|
+
await e(is, where())
|
|
131
139
|
}
|
|
132
140
|
|
|
133
141
|
const properties = flattenInPlace(argument)
|
|
@@ -137,7 +145,7 @@ const template = {
|
|
|
137
145
|
const query = memoizeAsync(async () => await(gp(await fragments("what is the concept?", { concept: property }))))
|
|
138
146
|
const compatible_types = property.compatible_types || [property.marker]
|
|
139
147
|
const matchr = ({context, isA}) => {
|
|
140
|
-
return !context.same &&
|
|
148
|
+
return !context.same && isA(context, compatible_types)
|
|
141
149
|
}
|
|
142
150
|
objects.askFor.push(property);
|
|
143
151
|
askForProperty({
|
package/common/asking.js
CHANGED
|
@@ -26,6 +26,7 @@ const config = {
|
|
|
26
26
|
bridges: [
|
|
27
27
|
{
|
|
28
28
|
id: "nevermind",
|
|
29
|
+
where: where(),
|
|
29
30
|
bridge: "{ ...next(operator), complete: true }",
|
|
30
31
|
semantic: (args) => {
|
|
31
32
|
const {config, context} = args
|
|
@@ -51,6 +52,7 @@ const config = {
|
|
|
51
52
|
|
|
52
53
|
{
|
|
53
54
|
id: "whichOnesTestSetup",
|
|
55
|
+
where: where(),
|
|
54
56
|
scope: "testing",
|
|
55
57
|
generatorp: async ({context, gs}) => `${context.marker} ${await gs(context.choices)}`,
|
|
56
58
|
bridge: "{ ...next(operator), choices: after[0] }",
|
|
@@ -91,6 +93,7 @@ const config = {
|
|
|
91
93
|
|
|
92
94
|
{
|
|
93
95
|
id: "nevermindTestSetup",
|
|
96
|
+
where: where(),
|
|
94
97
|
scope: "testing",
|
|
95
98
|
bridge: "{ ...next(operator), type: after[0], postModifiers: ['type'] }",
|
|
96
99
|
semantic: ({ask, context}) => {
|
|
@@ -156,7 +159,9 @@ function getAsk(config) {
|
|
|
156
159
|
oneShot: ask.oneShot ?? true,
|
|
157
160
|
where: semantic.where || ask.where || where(2),
|
|
158
161
|
source: 'response',
|
|
159
|
-
match: (args) =>
|
|
162
|
+
match: async (args) => await args.callOnce(args, 'asking.1', async (args) => {
|
|
163
|
+
return !args.context.isResponse && args.context.topLevel && !args.context.isControl && await semantic.match(args)
|
|
164
|
+
}),
|
|
160
165
|
apply: async (args) => {
|
|
161
166
|
setWasApplied(true)
|
|
162
167
|
await semantic.apply({ ...args, tag: ask.tag })
|
|
@@ -187,13 +192,13 @@ function getAsk(config) {
|
|
|
187
192
|
matchq = () => !wasAsked,
|
|
188
193
|
applyq = (args) => {
|
|
189
194
|
wasAsked = true
|
|
190
|
-
return ask.applyq({ ...args, tag: ask.tag })
|
|
195
|
+
return args.stack.wrap(() => ask.applyq({ ...args, tag: ask.tag }), where())
|
|
191
196
|
}
|
|
192
197
|
}
|
|
193
|
-
if (await matchq(args)) {
|
|
198
|
+
if (await args.stack.wrap(() => matchq(args), where())) {
|
|
194
199
|
setWasApplied(false)
|
|
195
200
|
// args.context.motivationKeep = true
|
|
196
|
-
const query = await applyq({ ...args, wasAsked: getWasAsked() })
|
|
201
|
+
const query = await args.stack.wrap(() => applyq({ ...args, wasAsked: getWasAsked() }), where())
|
|
197
202
|
if (typeof query != 'string') {
|
|
198
203
|
throw new Error(`ask expects the value return from applyq to be a string. ${ask.where}. Instead got ${JSON.stringify(query, null, 2)}.`)
|
|
199
204
|
}
|
package/common/avatar.js
CHANGED
|
@@ -27,7 +27,7 @@ const config = {
|
|
|
27
27
|
{
|
|
28
28
|
where: where(),
|
|
29
29
|
notes: "unknown answer default response for avatar",
|
|
30
|
-
match: ({context}) => context.marker
|
|
30
|
+
match: ({context}) => context.marker === 'undefined',
|
|
31
31
|
apply: ({context}) => `I don't know`,
|
|
32
32
|
},
|
|
33
33
|
{
|
package/common/can.instance.json
CHANGED
|
@@ -298,15 +298,7 @@
|
|
|
298
298
|
"voice": "passive",
|
|
299
299
|
"level": 1,
|
|
300
300
|
"context_index": 1,
|
|
301
|
-
"topLevel": true
|
|
302
|
-
"control": {
|
|
303
|
-
"seen": {
|
|
304
|
-
"length": 0
|
|
305
|
-
}
|
|
306
|
-
},
|
|
307
|
-
"touchedBy": [
|
|
308
|
-
"can#call2"
|
|
309
|
-
]
|
|
301
|
+
"topLevel": true
|
|
310
302
|
}
|
|
311
303
|
],
|
|
312
304
|
"generated": [
|
|
@@ -801,15 +793,7 @@
|
|
|
801
793
|
],
|
|
802
794
|
"level": 1,
|
|
803
795
|
"context_index": 1,
|
|
804
|
-
"topLevel": true
|
|
805
|
-
"control": {
|
|
806
|
-
"seen": {
|
|
807
|
-
"length": 0
|
|
808
|
-
}
|
|
809
|
-
},
|
|
810
|
-
"touchedBy": [
|
|
811
|
-
"can#call2"
|
|
812
|
-
]
|
|
796
|
+
"topLevel": true
|
|
813
797
|
}
|
|
814
798
|
],
|
|
815
799
|
"generated": [
|
package/common/can.js
CHANGED
|
@@ -115,7 +115,7 @@ const config = {
|
|
|
115
115
|
semantics: [
|
|
116
116
|
{
|
|
117
117
|
match: ({context}) => context.toVoice == 'passive',
|
|
118
|
-
apply: async ({g, context
|
|
118
|
+
apply: async ({g, context}) => {
|
|
119
119
|
for (const element of propertyToArray(context)) {
|
|
120
120
|
if (!element.voice) {
|
|
121
121
|
continue
|
|
@@ -140,7 +140,7 @@ const config = {
|
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
142
|
match: ({context}) => context.toVoice == 'active',
|
|
143
|
-
apply: async ({g, context
|
|
143
|
+
apply: async ({g, context}) => {
|
|
144
144
|
// From
|
|
145
145
|
// [{"property":"canSubject"},{"property":"operator","number":"canSubject"},{"property":"canObject"}]
|
|
146
146
|
for (const element of propertyToArray(context)) {
|
|
@@ -1339,8 +1339,7 @@
|
|
|
1339
1339
|
"queryable",
|
|
1340
1340
|
"unknown"
|
|
1341
1341
|
],
|
|
1342
|
-
"level": 0
|
|
1343
|
-
"evaluate": false
|
|
1342
|
+
"level": 0
|
|
1344
1343
|
},
|
|
1345
1344
|
"two": {
|
|
1346
1345
|
"value": "concepts",
|
|
@@ -1627,8 +1626,7 @@
|
|
|
1627
1626
|
"queryable",
|
|
1628
1627
|
"unknown"
|
|
1629
1628
|
],
|
|
1630
|
-
"level": 0
|
|
1631
|
-
"evaluate": false
|
|
1629
|
+
"level": 0
|
|
1632
1630
|
},
|
|
1633
1631
|
"two": {
|
|
1634
1632
|
"value": "condition",
|
|
@@ -2200,8 +2198,7 @@
|
|
|
2200
2198
|
"types": [
|
|
2201
2199
|
"unknown"
|
|
2202
2200
|
],
|
|
2203
|
-
"level": 0
|
|
2204
|
-
"evaluate": false
|
|
2201
|
+
"level": 0
|
|
2205
2202
|
},
|
|
2206
2203
|
{
|
|
2207
2204
|
"value": "lowest",
|
|
@@ -2232,8 +2229,7 @@
|
|
|
2232
2229
|
"types": [
|
|
2233
2230
|
"unknown"
|
|
2234
2231
|
],
|
|
2235
|
-
"level": 0
|
|
2236
|
-
"evaluate": false
|
|
2232
|
+
"level": 0
|
|
2237
2233
|
},
|
|
2238
2234
|
{
|
|
2239
2235
|
"value": "maximum",
|
|
@@ -2249,8 +2245,7 @@
|
|
|
2249
2245
|
"types": [
|
|
2250
2246
|
"unknown"
|
|
2251
2247
|
],
|
|
2252
|
-
"level": 0
|
|
2253
|
-
"evaluate": false
|
|
2248
|
+
"level": 0
|
|
2254
2249
|
},
|
|
2255
2250
|
{
|
|
2256
2251
|
"value": "minimum",
|
|
@@ -2266,8 +2261,7 @@
|
|
|
2266
2261
|
"types": [
|
|
2267
2262
|
"unknown"
|
|
2268
2263
|
],
|
|
2269
|
-
"level": 0
|
|
2270
|
-
"evaluate": false
|
|
2264
|
+
"level": 0
|
|
2271
2265
|
}
|
|
2272
2266
|
],
|
|
2273
2267
|
"level": 1
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
{
|
|
12
12
|
"id": "modifies",
|
|
13
13
|
"enhanced_associations": false,
|
|
14
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:28",
|
|
14
15
|
"isA": [
|
|
15
16
|
"verb"
|
|
16
17
|
],
|
|
@@ -100,6 +101,7 @@
|
|
|
100
101
|
"bridges": [
|
|
101
102
|
{
|
|
102
103
|
"id": "isOpenCompound",
|
|
104
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:154",
|
|
103
105
|
"isA": [
|
|
104
106
|
"verb"
|
|
105
107
|
],
|
|
@@ -142,6 +144,7 @@
|
|
|
142
144
|
{
|
|
143
145
|
"id": "modifies",
|
|
144
146
|
"enhanced_associations": false,
|
|
147
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:28",
|
|
145
148
|
"isA": [
|
|
146
149
|
"verb"
|
|
147
150
|
],
|
|
@@ -160,7 +163,7 @@
|
|
|
160
163
|
"bridge": "{ ...next(operator), conceptModifiers: before[0], concept: after[0] }",
|
|
161
164
|
"semantic": {
|
|
162
165
|
"notes": "define a modifier",
|
|
163
|
-
"where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:
|
|
166
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:35"
|
|
164
167
|
},
|
|
165
168
|
"check": [
|
|
166
169
|
"marker",
|
|
@@ -217,10 +220,10 @@
|
|
|
217
220
|
"generators": [
|
|
218
221
|
{
|
|
219
222
|
"notes": "\"fire type, water type and earth type\" to \"fire water and earth type\"",
|
|
220
|
-
"where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:
|
|
223
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:85"
|
|
221
224
|
},
|
|
222
225
|
{
|
|
223
|
-
"where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:
|
|
226
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:124"
|
|
224
227
|
}
|
|
225
228
|
]
|
|
226
229
|
},
|
|
@@ -682,6 +685,7 @@
|
|
|
682
685
|
"bridges": [
|
|
683
686
|
{
|
|
684
687
|
"id": "isOpenCompound",
|
|
688
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:154",
|
|
685
689
|
"isA": [
|
|
686
690
|
"verb"
|
|
687
691
|
],
|
|
@@ -690,7 +694,7 @@
|
|
|
690
694
|
"is"
|
|
691
695
|
],
|
|
692
696
|
"semantic": {
|
|
693
|
-
"where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:
|
|
697
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/concept.js:165"
|
|
694
698
|
},
|
|
695
699
|
"enhanced_associations": true,
|
|
696
700
|
"check": [
|