tpmkms_4wp 9.8.0-beta.10 → 9.8.0-beta.16
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 +3 -3
- package/common/actions.js +9 -9
- package/common/askfor.instance.json +8 -186
- package/common/askfor.js +16 -11
- package/common/can.instance.json +2 -18
- package/common/can.js +2 -2
- package/common/comparable.instance.json +6 -12
- package/common/conjunction.js +4 -4
- package/common/dateTimeSelectors.instance.json +1 -1
- package/common/dateTimeSelectors.js +1 -1
- package/common/dates.instance.json +1 -1
- package/common/dates.js +1 -1
- package/common/dialogues.js +34 -35
- package/common/dimension.instance.json +5 -433
- package/common/dimension.js +7 -7
- package/common/drone.instance.json +18 -18
- package/common/drone.js +17 -18
- package/common/drone_v1.instance.json +3 -3
- package/common/drone_v1.js +4 -4
- package/common/evaluate.js +2 -2
- package/common/fastfood.instance.json +2 -2
- package/common/fastfood.js +18 -9
- package/common/formulas.instance.json +4 -4
- package/common/formulas.js +4 -4
- package/common/gdefaults.js +2 -71
- package/common/helpers/dialogues.js +1 -10
- package/common/helpers/properties.js +6 -10
- package/common/helpers.js +5 -1
- package/common/hierarchy.js +7 -6
- package/common/math.instance.json +13 -4
- package/common/math.js +13 -3
- package/common/menus.instance.json +1 -1
- package/common/menus.js +2 -2
- package/common/meta.js +12 -12
- package/common/nameable.js +1 -1
- package/common/ordering.instance.json +1 -2
- package/common/percentages.js +2 -2
- package/common/pipboy.instance.json +4 -5
- package/common/pipboy.js +3 -3
- package/common/properties.instance.json +2318 -559
- package/common/properties.js +145 -35
- package/common/rates.instance.json +1 -1
- package/common/rates.js +2 -2
- package/common/reports.instance.json +4 -6
- package/common/reports.js +12 -12
- package/common/sdefaults.js +8 -7
- package/common/stm.js +8 -14
- package/common/testing.js +2 -2
- package/common/time.instance.json +2 -5
- package/common/time.js +4 -4
- package/common/ui.js +5 -5
- package/common/words.js +106 -1
- package/common/wp.instance.json +4 -3
- package/common/wp.js +2 -1
- 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": {
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
"semantics": [
|
|
168
168
|
{
|
|
169
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,
|
|
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
|
},
|
|
@@ -150,9 +150,9 @@ const config = {
|
|
|
150
150
|
match: ({context, isA, contextHierarchy, stack, namespaced}) => {
|
|
151
151
|
return !context.pullFromContext && !contextHierarchy.under('call') && (isA(context.marker, 'action') || isA(context.marker, 'doAction')) && !namespaced.get('actions', context, 'logged')
|
|
152
152
|
},
|
|
153
|
-
apply: async ({context, _continue, testLog,
|
|
153
|
+
apply: async ({context, _continue, testLog, gp, remember}) => {
|
|
154
154
|
remember(context)
|
|
155
|
-
await testLog(() =>
|
|
155
|
+
await testLog(() => gp(context))
|
|
156
156
|
_continue()
|
|
157
157
|
}
|
|
158
158
|
},
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"isA": [
|
|
35
35
|
"queryable"
|
|
36
36
|
],
|
|
37
|
-
"
|
|
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 }"
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"id": "information",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"isA": [
|
|
43
43
|
"noun"
|
|
44
44
|
],
|
|
45
|
-
"
|
|
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 }"
|
|
46
46
|
},
|
|
47
47
|
{
|
|
48
48
|
"id": "for_askfor",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
"id": "askfor_askfor",
|
|
62
|
-
"where": "/home/dev/code/theprogrammablemind/kms/common/askfor.js:
|
|
62
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/askfor.js:114",
|
|
63
63
|
"isA": [
|
|
64
64
|
"verb"
|
|
65
65
|
],
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"ask"
|
|
68
68
|
],
|
|
69
69
|
"bridge": "{\n ...next(operator),\n properties: after[0],\n interpolate: [{ self: true }, { property: 'properties' }]\n }",
|
|
70
|
-
"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 }"
|
|
71
71
|
}
|
|
72
72
|
]
|
|
73
73
|
},
|
|
@@ -443,189 +443,11 @@
|
|
|
443
443
|
],
|
|
444
444
|
"level": 2,
|
|
445
445
|
"context_index": 1,
|
|
446
|
-
"topLevel": true
|
|
447
|
-
"evalue": {
|
|
448
|
-
"default": true,
|
|
449
|
-
"marker": "is",
|
|
450
|
-
"one": {
|
|
451
|
-
"marker": "concept",
|
|
452
|
-
"value": "concept",
|
|
453
|
-
"default": true,
|
|
454
|
-
"text": "the concept",
|
|
455
|
-
"dead": true,
|
|
456
|
-
"word": "concept",
|
|
457
|
-
"range": {
|
|
458
|
-
"start": 8,
|
|
459
|
-
"end": 18
|
|
460
|
-
},
|
|
461
|
-
"types": [
|
|
462
|
-
"concept"
|
|
463
|
-
],
|
|
464
|
-
"focusableForPhrase": true,
|
|
465
|
-
"pullFromContext": true,
|
|
466
|
-
"concept": true,
|
|
467
|
-
"wantsValue": true,
|
|
468
|
-
"checks": [
|
|
469
|
-
"determiner"
|
|
470
|
-
],
|
|
471
|
-
"determiner": {
|
|
472
|
-
"modifiers": [],
|
|
473
|
-
"text": "the",
|
|
474
|
-
"marker": "the",
|
|
475
|
-
"word": "the",
|
|
476
|
-
"range": {
|
|
477
|
-
"start": 8,
|
|
478
|
-
"end": 10
|
|
479
|
-
},
|
|
480
|
-
"level": 0
|
|
481
|
-
},
|
|
482
|
-
"theable": {
|
|
483
|
-
"marker": "concept",
|
|
484
|
-
"value": "concept",
|
|
485
|
-
"default": true,
|
|
486
|
-
"text": "concept",
|
|
487
|
-
"dead": true,
|
|
488
|
-
"word": "concept",
|
|
489
|
-
"range": {
|
|
490
|
-
"start": 12,
|
|
491
|
-
"end": 18
|
|
492
|
-
},
|
|
493
|
-
"types": [
|
|
494
|
-
"concept"
|
|
495
|
-
],
|
|
496
|
-
"level": 0
|
|
497
|
-
},
|
|
498
|
-
"flattenInPlace": [
|
|
499
|
-
[
|
|
500
|
-
"value",
|
|
501
|
-
"theable"
|
|
502
|
-
]
|
|
503
|
-
],
|
|
504
|
-
"flatten_ignore": [
|
|
505
|
-
"theable"
|
|
506
|
-
],
|
|
507
|
-
"interpolate": [
|
|
508
|
-
{
|
|
509
|
-
"property": "determiner"
|
|
510
|
-
},
|
|
511
|
-
{
|
|
512
|
-
"property": "theable"
|
|
513
|
-
}
|
|
514
|
-
],
|
|
515
|
-
"level": 0
|
|
516
|
-
},
|
|
517
|
-
"two": {
|
|
518
|
-
"marker": "concept",
|
|
519
|
-
"value": {
|
|
520
|
-
"marker": "surname",
|
|
521
|
-
"isVariable": true,
|
|
522
|
-
"evaluate": false,
|
|
523
|
-
"pullFromContext": false,
|
|
524
|
-
"value": "last_name",
|
|
525
|
-
"fromSTM": true,
|
|
526
|
-
"namespaced": {
|
|
527
|
-
"stm": {
|
|
528
|
-
"id": 1
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
},
|
|
532
|
-
"default": true,
|
|
533
|
-
"text": "the concept",
|
|
534
|
-
"dead": true,
|
|
535
|
-
"word": "concept",
|
|
536
|
-
"range": {
|
|
537
|
-
"start": 8,
|
|
538
|
-
"end": 18
|
|
539
|
-
},
|
|
540
|
-
"types": [
|
|
541
|
-
"concept"
|
|
542
|
-
],
|
|
543
|
-
"focusableForPhrase": true,
|
|
544
|
-
"pullFromContext": true,
|
|
545
|
-
"concept": true,
|
|
546
|
-
"wantsValue": true,
|
|
547
|
-
"checks": [
|
|
548
|
-
"determiner"
|
|
549
|
-
],
|
|
550
|
-
"determiner": {
|
|
551
|
-
"modifiers": [],
|
|
552
|
-
"text": "the",
|
|
553
|
-
"marker": "the",
|
|
554
|
-
"word": "the",
|
|
555
|
-
"range": {
|
|
556
|
-
"start": 8,
|
|
557
|
-
"end": 10
|
|
558
|
-
},
|
|
559
|
-
"level": 0
|
|
560
|
-
},
|
|
561
|
-
"theable": {
|
|
562
|
-
"marker": "concept",
|
|
563
|
-
"value": "concept",
|
|
564
|
-
"default": true,
|
|
565
|
-
"text": "concept",
|
|
566
|
-
"dead": true,
|
|
567
|
-
"word": "concept",
|
|
568
|
-
"range": {
|
|
569
|
-
"start": 12,
|
|
570
|
-
"end": 18
|
|
571
|
-
},
|
|
572
|
-
"types": [
|
|
573
|
-
"concept"
|
|
574
|
-
],
|
|
575
|
-
"level": 0
|
|
576
|
-
},
|
|
577
|
-
"flattenInPlace": [
|
|
578
|
-
[
|
|
579
|
-
"value",
|
|
580
|
-
"theable"
|
|
581
|
-
]
|
|
582
|
-
],
|
|
583
|
-
"flatten_ignore": [
|
|
584
|
-
"theable"
|
|
585
|
-
],
|
|
586
|
-
"interpolate": [
|
|
587
|
-
{
|
|
588
|
-
"property": "determiner"
|
|
589
|
-
},
|
|
590
|
-
{
|
|
591
|
-
"property": "theable"
|
|
592
|
-
}
|
|
593
|
-
],
|
|
594
|
-
"level": 0,
|
|
595
|
-
"evalue": {
|
|
596
|
-
"marker": "surname",
|
|
597
|
-
"isVariable": true,
|
|
598
|
-
"evaluate": false,
|
|
599
|
-
"pullFromContext": false,
|
|
600
|
-
"value": "last_name",
|
|
601
|
-
"fromSTM": true,
|
|
602
|
-
"namespaced": {
|
|
603
|
-
"stm": {
|
|
604
|
-
"id": 1
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
},
|
|
608
|
-
"touchedBy": [
|
|
609
|
-
"askfor#call3",
|
|
610
|
-
"askfor#call2"
|
|
611
|
-
],
|
|
612
|
-
"instance": true,
|
|
613
|
-
"focus": true
|
|
614
|
-
},
|
|
615
|
-
"focusable": [
|
|
616
|
-
"two",
|
|
617
|
-
"one"
|
|
618
|
-
],
|
|
619
|
-
"word": "is"
|
|
620
|
-
},
|
|
621
|
-
"isResponse": true,
|
|
622
|
-
"touchedBy": [
|
|
623
|
-
"askfor#call2"
|
|
624
|
-
]
|
|
446
|
+
"topLevel": true
|
|
625
447
|
}
|
|
626
448
|
],
|
|
627
449
|
"generated": [
|
|
628
|
-
"
|
|
450
|
+
""
|
|
629
451
|
],
|
|
630
452
|
"paraphrases": [
|
|
631
453
|
"what is the concept?"
|
|
@@ -633,7 +455,7 @@
|
|
|
633
455
|
"paraphrasesParenthesized": [],
|
|
634
456
|
"generatedParenthesized": [],
|
|
635
457
|
"responses": [
|
|
636
|
-
"
|
|
458
|
+
""
|
|
637
459
|
],
|
|
638
460
|
"associations": [],
|
|
639
461
|
"summaries": [
|
|
@@ -923,7 +745,7 @@
|
|
|
923
745
|
},
|
|
924
746
|
{
|
|
925
747
|
"id": "askfor_askfor",
|
|
926
|
-
"where": "/home/dev/code/theprogrammablemind/kms/common/askfor.js:
|
|
748
|
+
"where": "/home/dev/code/theprogrammablemind/kms/common/askfor.js:114",
|
|
927
749
|
"isA": [
|
|
928
750
|
"verb"
|
|
929
751
|
],
|
package/common/askfor.js
CHANGED
|
@@ -76,7 +76,7 @@ const template = {
|
|
|
76
76
|
id: 'known',
|
|
77
77
|
where: where(),
|
|
78
78
|
isA: ['queryable'],
|
|
79
|
-
|
|
79
|
+
semantic: async ({kms, context, e, callId, toList, flatten, toEValue, resolveEvaluate, objects}) => {
|
|
80
80
|
const known = await kms.properties.api.getProperty(context.subjects[0], 'property')
|
|
81
81
|
resolveEvaluate(context, known)
|
|
82
82
|
},
|
|
@@ -85,13 +85,15 @@ const template = {
|
|
|
85
85
|
id: 'information',
|
|
86
86
|
where: where(),
|
|
87
87
|
isA: ['noun'],
|
|
88
|
-
|
|
88
|
+
semantic: async ({context, e, callId, toList, flatten, toEValue, resolveEvaluate, objects}) => {
|
|
89
89
|
const properties = objects.askFor
|
|
90
90
|
const values = []
|
|
91
91
|
for (const property of properties) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
try {
|
|
93
|
+
const value = (await e(property, where())).evalue
|
|
94
|
+
values.push({ marker: 'labelledValue', label: property, value })
|
|
95
|
+
} catch( e ) {
|
|
96
|
+
}
|
|
95
97
|
}
|
|
96
98
|
resolveEvaluate(context, toList(values))
|
|
97
99
|
},
|
|
@@ -117,20 +119,23 @@ const template = {
|
|
|
117
119
|
properties: after[0],
|
|
118
120
|
interpolate: [{ self: true }, { property: 'properties' }]
|
|
119
121
|
}`,
|
|
120
|
-
semantic: async ({e,
|
|
122
|
+
semantic: async ({e, gp, objects, flatten, context, ask, fragments, toEValue}) => {
|
|
121
123
|
const argument = context.properties.argument
|
|
122
124
|
const getValue = (property) => async (args) => {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
try {
|
|
126
|
+
const value = toEValue(await e(property, where()))
|
|
127
|
+
if (value.marker === 'undefined') {
|
|
128
|
+
return
|
|
129
|
+
}
|
|
130
|
+
return value
|
|
131
|
+
} catch (e) {
|
|
126
132
|
}
|
|
127
|
-
return value
|
|
128
133
|
}
|
|
129
134
|
|
|
130
135
|
const setValue = (property) => async ({ context, namespaced, tag }) => {
|
|
131
136
|
const is = { marker: 'is', one: property, two: context }
|
|
132
137
|
namespaced.set('dialogs', is, 'allowHierarchy', false)
|
|
133
|
-
await
|
|
138
|
+
await e(is, where())
|
|
134
139
|
}
|
|
135
140
|
|
|
136
141
|
const properties = flattenInPlace(argument)
|
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
|
package/common/conjunction.js
CHANGED
|
@@ -42,10 +42,10 @@ const config = {
|
|
|
42
42
|
where: where(),
|
|
43
43
|
semantic: {
|
|
44
44
|
match: ({context, namespaced}) => !namespaced.get('conjunction', context, 'atomic'),
|
|
45
|
-
apply: async ({context, flatten,
|
|
45
|
+
apply: async ({context, flatten, e}) => {
|
|
46
46
|
for (const value of flatten(context)) {
|
|
47
47
|
value.topLevel = context.topLevel;
|
|
48
|
-
await
|
|
48
|
+
await e(value, where())
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -55,11 +55,11 @@ const config = {
|
|
|
55
55
|
{
|
|
56
56
|
where: where(),
|
|
57
57
|
notes: 'evaluate elements of the list individually',
|
|
58
|
-
match: ({context, callId}) => context.marker == 'list' && context.
|
|
58
|
+
match: ({context, callId}) => context.marker == 'list' && !context.topLevel,
|
|
59
59
|
apply: async ({context, toArray, toList, e, resolveEvaluate}) => {
|
|
60
60
|
const list = []
|
|
61
61
|
for (const element of toArray(context)) {
|
|
62
|
-
list.push(await e(element))
|
|
62
|
+
list.push(await e(element, where()))
|
|
63
63
|
}
|
|
64
64
|
resolveEvaluate(context, toList(list))
|
|
65
65
|
}
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"semantics": [
|
|
69
69
|
{
|
|
70
70
|
"match": "({context, isA}) => onOrIs('dayAfterDate', context)",
|
|
71
|
-
"apply": "async ({context, isProcess, isTest, kms, isA, e}) => {\n try {\n const now = kms.time.api.now()\n const date = afterOrIs('dayAfterDate', context)\n const afterISO = (await e(date.after)).evalue\n const day_ordinal = date.day.day_ordinal\n const ordinal = date.day.ordinal.value\n context.evalue = dateTimeSelectors_helpers.getNthWeekdayAfterDate(afterISO, day_ordinal, ordinal)\n } catch ( e ) {\n context.evalue = `Implement instatiate for this type of date, ${context.marker}. See the dateTimeSelectors KM ${where()}. ${e}`\n }\n }"
|
|
71
|
+
"apply": "async ({context, isProcess, isTest, kms, isA, e}) => {\n try {\n const now = kms.time.api.now()\n const date = afterOrIs('dayAfterDate', context)\n const afterISO = (await e(date.after, where())).evalue\n const day_ordinal = date.day.day_ordinal\n const ordinal = date.day.ordinal.value\n context.evalue = dateTimeSelectors_helpers.getNthWeekdayAfterDate(afterISO, day_ordinal, ordinal)\n } catch ( e ) {\n context.evalue = `Implement instatiate for this type of date, ${context.marker}. See the dateTimeSelectors KM ${where()}. ${e}`\n }\n }"
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
"match": "({context, isA}) => onOrIs('dayOfMonth', context)",
|
|
@@ -99,7 +99,7 @@ const template = {
|
|
|
99
99
|
try {
|
|
100
100
|
const now = kms.time.api.now()
|
|
101
101
|
const date = afterOrIs('dayAfterDate', context)
|
|
102
|
-
const afterISO = (await e(date.after)).evalue
|
|
102
|
+
const afterISO = (await e(date.after, where())).evalue
|
|
103
103
|
const day_ordinal = date.day.day_ordinal
|
|
104
104
|
const ordinal = date.day.ordinal.value
|
|
105
105
|
context.evalue = dateTimeSelectors_helpers.getNthWeekdayAfterDate(afterISO, day_ordinal, ordinal)
|
|
@@ -341,7 +341,7 @@
|
|
|
341
341
|
"isA": [
|
|
342
342
|
"date_dates"
|
|
343
343
|
],
|
|
344
|
-
"
|
|
344
|
+
"semantic": "({context}) => {\n const year = context.year.value\n const day = context.day.value\n const month_ordinal = context.month.month_ordinal\n context.evalue = new Date(year, month_ordinal-1, day).toISOString()\n }",
|
|
345
345
|
"localHierarchy": [
|
|
346
346
|
[
|
|
347
347
|
"ordinal",
|
package/common/dates.js
CHANGED
|
@@ -192,7 +192,7 @@ const template = {
|
|
|
192
192
|
convolution: true,
|
|
193
193
|
before: ['preposition', 'monthDay_dates'],
|
|
194
194
|
isA: ['date_dates'],
|
|
195
|
-
|
|
195
|
+
semantic: ({context}) => {
|
|
196
196
|
const year = context.year.value
|
|
197
197
|
const day = context.day.value
|
|
198
198
|
const month_ordinal = context.month.month_ordinal
|