ekms 8.0.0-beta.21 → 8.0.0-beta.23
Sign up to get free protection for your applications and to get access to all the features.
- package/common/colors.instance.json +0 -28
- package/common/comparable.js +0 -13
- package/common/concept.js +9 -5
- package/common/countable.js +3 -3
- package/common/crew.js +1 -1
- package/common/currency.js +3 -3
- package/common/dialogues.js +48 -117
- package/common/dimension.instance.json +4 -4
- package/common/dimension.js +8 -8
- package/common/dimension.test.json +242 -1248
- package/common/edible.instance.json +30 -58
- package/common/emotions.js +1 -1
- package/common/events.js +3 -3
- package/common/fastfood.instance.json +873 -1072
- package/common/fastfood.js +20 -20
- package/common/formulas.instance.json +6 -6
- package/common/formulas.js +8 -8
- package/common/gdefaults.js +11 -11
- package/common/help.js +1 -1
- package/common/helpers/dialogues.js +2 -3
- package/common/helpers/properties.js +48 -58
- package/common/hierarchy.js +9 -13
- package/common/javascript.js +5 -5
- package/common/math.instance.json +12 -12
- package/common/math.js +5 -5
- package/common/meta.js +19 -26
- package/common/ordering.js +1 -1
- package/common/people.js +1 -2
- package/common/percentages.js +2 -2
- package/common/pipboy.instance.json +30 -86
- package/common/pipboy.js +25 -28
- package/common/pokemon.js +1 -1
- package/common/properties.js +48 -121
- package/common/punctuation.js +1 -1
- package/common/reports.instance.json +1 -1
- package/common/reports.js +48 -65
- package/common/scorekeeper.js +10 -18
- package/common/sdefaults.js +4 -4
- package/common/stm.js +1 -1
- package/common/tell.js +6 -6
- package/common/temperature.instance.json +0 -84
- package/common/testing.js +3 -3
- package/common/time.js +3 -3
- package/common/ui.js +5 -5
- package/package.json +2 -2
package/common/reports.js
CHANGED
@@ -100,7 +100,7 @@ const apiTemplate = (marker, testData) => {
|
|
100
100
|
},
|
101
101
|
productGenerator: {
|
102
102
|
match: ({context}) => context.marker == marker && context.isInstance,
|
103
|
-
apply: ({
|
103
|
+
apply: ({context}) => `${context.name}`,
|
104
104
|
}
|
105
105
|
}
|
106
106
|
}
|
@@ -190,9 +190,9 @@ let configStruct = {
|
|
190
190
|
bridge: "{ ...next(operator), on: { marker: 'report', pullFromContext: true }, from: after[0], to: after[1] }",
|
191
191
|
directionBridge: "{ ...next(operator), on: { marker: 'report', pullFromContext: true }, directionBridge: true, from: after[0], to: after[1] }",
|
192
192
|
|
193
|
-
generatorp: ({context, gp}) => `move ${gp(context.from)} ${gp(context.to)}`,
|
194
|
-
semantic: ({context, e, objects, kms, insert}) => {
|
195
|
-
const report = e(context.on)
|
193
|
+
generatorp: async ({context, gp}) => `move ${await gp(context.from)} ${await gp(context.to)}`,
|
194
|
+
semantic: async ({context, e, objects, kms, insert}) => {
|
195
|
+
const report = await e(context.on)
|
196
196
|
const id = report.value.value
|
197
197
|
const listing = objects.listings[id]
|
198
198
|
|
@@ -218,9 +218,9 @@ let configStruct = {
|
|
218
218
|
where: where(),
|
219
219
|
id: "remove", level: 0,
|
220
220
|
bridge: "{ ...next(operator), on: { marker: 'report', pullFromContext: true }, removee: after[0] }",
|
221
|
-
generatorp: ({context, gp}) => `remove ${gp(context.removee)}`,
|
222
|
-
semantic: ({context, e, kms, insert, objects}) => {
|
223
|
-
const report = e(context.on)
|
221
|
+
generatorp: async ({context, gp}) => `remove ${await gp(context.removee)}`,
|
222
|
+
semantic: async ({context, e, kms, insert, objects}) => {
|
223
|
+
const report = await e(context.on)
|
224
224
|
const id = report.value.value
|
225
225
|
const listing = objects.listings[id]
|
226
226
|
const column = context.removee.index.value
|
@@ -232,7 +232,7 @@ let configStruct = {
|
|
232
232
|
where: where(),
|
233
233
|
id: "column", level: 0,
|
234
234
|
bridge: "{ ...next(operator), index: after[0] }",
|
235
|
-
generatorp: ({context, gp}) => `column ${gp(context.index)}`,
|
235
|
+
generatorp: async ({context, gp}) => `column ${await gp(context.index)}`,
|
236
236
|
},
|
237
237
|
{ id: "ordering", level: 0, bridge: "{ ...next(operator) }" },
|
238
238
|
{ id: "direction", level: 0, bridge: "{ ...next(operator) }" },
|
@@ -248,10 +248,10 @@ let configStruct = {
|
|
248
248
|
{
|
249
249
|
where: where(),
|
250
250
|
match: ({context}) => context.marker == 'report' && context.describe,
|
251
|
-
apply: ({context, apis,
|
251
|
+
apply: async ({context, apis, gs, objects}) => {
|
252
252
|
const listings = objects.listings[context.value]
|
253
253
|
// {"type":"tables","columns":["name"],"ordering":[]}
|
254
|
-
return `for ${listings.api}, showing the ${wordNumber('property', listings.columns.length > 1)} ${gs(listings.columns, ' ', ' and ')} as ${listings.type}`
|
254
|
+
return `for ${listings.api}, showing the ${wordNumber('property', listings.columns.length > 1)} ${await gs(listings.columns, ' ', ' and ')} as ${listings.type}`
|
255
255
|
}
|
256
256
|
},
|
257
257
|
{
|
@@ -297,8 +297,8 @@ let configStruct = {
|
|
297
297
|
level: 0,
|
298
298
|
isA: ['verby'],
|
299
299
|
bridge: "{ ...next(operator), report: after[0] }",
|
300
|
-
"generatorp": ({g, context}) => `describe ${g(context.report)}`,
|
301
|
-
"generatorr": ({gp, context, apis, objects, config}) => {
|
300
|
+
"generatorp": async ({g, context}) => `describe ${await g(context.report)}`,
|
301
|
+
"generatorr": async ({gp, context, apis, objects, config}) => {
|
302
302
|
const reports = propertyToArray(context.report)
|
303
303
|
let response = ''
|
304
304
|
for (let report of reports) {
|
@@ -308,11 +308,11 @@ let configStruct = {
|
|
308
308
|
continue
|
309
309
|
}
|
310
310
|
const description = {describe: true, word: reportId, types:["report"], value: reportId, text: reportId, marker: "report"}
|
311
|
-
response += `${reportId}: ${gp(description)}\n`
|
311
|
+
response += `${reportId}: ${await gp(description)}\n`
|
312
312
|
}
|
313
313
|
} else {
|
314
314
|
// response += `${gp(report)}: ${describe(report.value)}\n`
|
315
|
-
response += `${gp(report)}: ${gp({ ...report, describe: true })}\n`
|
315
|
+
response += `${await gp(report)}: ${await gp({ ...report, describe: true })}\n`
|
316
316
|
}
|
317
317
|
}
|
318
318
|
return response
|
@@ -327,9 +327,9 @@ let configStruct = {
|
|
327
327
|
id: "call",
|
328
328
|
level: 0,
|
329
329
|
bridge: "{ ...next(operator), namee: after[0], name: after[1] }",
|
330
|
-
generatorp: ({g, context}) => `call ${g(context.namee)} ${g(context.name)}`,
|
331
|
-
semantic: ({
|
332
|
-
const namee = e(context.namee).evalue
|
330
|
+
generatorp: async ({g, context}) => `call ${await g(context.namee)} ${await g(context.name)}`,
|
331
|
+
semantic: async ({context, objects, e, config, km}) => {
|
332
|
+
const namee = (await e(context.namee)).evalue
|
333
333
|
const id = namee.value
|
334
334
|
const listing = objects.listings[id]
|
335
335
|
const name = context.name.text
|
@@ -383,41 +383,23 @@ let configStruct = {
|
|
383
383
|
|
384
384
|
priorities: [
|
385
385
|
{ "context": [['ordering', 0], ['articlePOS', 0], ], "choose": [0] },
|
386
|
-
/*
|
387
|
-
[['the', 0], ['ordering', 0]],
|
388
|
-
[['listAction', 0], ['cost', 1]],
|
389
|
-
[['answer', 0], ['listAction', 0], ['the', 0]],
|
390
|
-
[['answer', 0], ['listAction', 0], ['the', 0], ['with', 0]],
|
391
|
-
*/
|
392
386
|
],
|
393
387
|
generators: [
|
394
388
|
{
|
395
389
|
notes: 'paraphrase show',
|
396
390
|
where: where(),
|
397
391
|
match: ({context, objects}) => context.marker == 'show' && context.paraphrase,
|
398
|
-
apply: ({gs,
|
392
|
+
apply: async ({gs, gp, e, apis, objects, context}) => {
|
399
393
|
if (context.report) {
|
400
|
-
return `show ${gp(context.report)}`
|
394
|
+
return `show ${await gp(context.report)}`
|
401
395
|
} else {
|
402
|
-
const report = e(context.on)
|
396
|
+
const report = await e(context.on)
|
403
397
|
const id = report.value.value
|
404
398
|
const listing = objects.listings[id]
|
405
|
-
return `the properties being shown are ${gs(listing.columns, ', ', ' and ')}`
|
399
|
+
return `the properties being shown are ${await gs(listing.columns, ', ', ' and ')}`
|
406
400
|
}
|
407
401
|
}
|
408
402
|
},
|
409
|
-
/*
|
410
|
-
{
|
411
|
-
where: where(),
|
412
|
-
match: ({context, isA}) => isA(context.marker, 'reportAction') && context.on && context.isResponse,
|
413
|
-
apply: ({context, g}) => `${g({...context, on: undefined})} on ${g(context.on)}`
|
414
|
-
},
|
415
|
-
{
|
416
|
-
where: where(),
|
417
|
-
match: ({context, isA}) => isA(context.marker, 'reportAction') && context.on && context.paraphrase,
|
418
|
-
apply: ({context, g}) => `${g({...context, on: undefined})} on ${g(context.on)}`
|
419
|
-
},
|
420
|
-
*/
|
421
403
|
{
|
422
404
|
where: where(),
|
423
405
|
match: ({context}) => context.marker == 'product' && !context.isInstance,
|
@@ -426,12 +408,12 @@ let configStruct = {
|
|
426
408
|
{
|
427
409
|
where: where(),
|
428
410
|
match: ({context}) => context.marker == 'listAction' && context.paraphrase,
|
429
|
-
apply: ({g, context}) => `list ${g(context.what)}`
|
411
|
+
apply: async ({g, context}) => `list ${await g(context.what)}`
|
430
412
|
},
|
431
413
|
{
|
432
414
|
notes: 'show the results as a sentence',
|
433
415
|
where: where(),
|
434
|
-
match: ({context, objects
|
416
|
+
match: ({context, objects}) => {
|
435
417
|
if (!(context.marker == 'listAction' && context.isResponse)) {
|
436
418
|
return false
|
437
419
|
}
|
@@ -439,15 +421,15 @@ let configStruct = {
|
|
439
421
|
return true
|
440
422
|
}
|
441
423
|
},
|
442
|
-
apply: ({g, gs, context, objects}) => {
|
424
|
+
apply: async ({g, gs, context, objects}) => {
|
443
425
|
const listing = objects.listings[context.id]
|
444
|
-
return `the ${g(listing.api)} are ${gs(context.listing, ' ', ' and ')}`
|
426
|
+
return `the ${await g(listing.api)} are ${await gs(context.listing, ' ', ' and ')}`
|
445
427
|
}
|
446
428
|
},
|
447
429
|
{
|
448
430
|
notes: 'show the results as a table',
|
449
431
|
where: where(),
|
450
|
-
match: ({context, objects
|
432
|
+
match: ({context, objects}) => {
|
451
433
|
if (!(context.marker == 'listAction' && context.isResponse && !context.paraphrase)) {
|
452
434
|
return false
|
453
435
|
}
|
@@ -455,7 +437,7 @@ let configStruct = {
|
|
455
437
|
return true
|
456
438
|
}
|
457
439
|
},
|
458
|
-
apply: ({
|
440
|
+
apply: async ({objects, context, e, kms}) => {
|
459
441
|
let report = '';
|
460
442
|
const products = context.listing
|
461
443
|
const columns = objects.listings[context.id].columns
|
@@ -463,20 +445,21 @@ let configStruct = {
|
|
463
445
|
kms.stm.api.setVariable('price', { marker: 'price', value: 23 })
|
464
446
|
kms.stm.api.setVariable('quantity', { marker: 'quantity', value: 3 })
|
465
447
|
const c1 = { marker: 'worth', value: 'worth' }
|
466
|
-
r1 = toEValue(e(c1));
|
467
|
-
r2 = e({ marker: 'supplier', value: 'supplier' })
|
448
|
+
r1 = toEValue(await e(c1));
|
449
|
+
r2 = await e({ marker: 'supplier', value: 'supplier' })
|
468
450
|
}
|
469
|
-
const data =
|
451
|
+
const data = []
|
452
|
+
for (const product of products) {
|
470
453
|
const row = []
|
471
454
|
for (let p of Object.keys(product)) {
|
472
455
|
kms.stm.api.setVariable(p, { marker: p, value: product[p] })
|
473
456
|
}
|
474
457
|
for (let property of columns) {
|
475
|
-
const value = toEValue(e({ marker: property, value: property }));
|
458
|
+
const value = toEValue(await e({ marker: property, value: property }));
|
476
459
|
row.push(value)
|
477
460
|
}
|
478
|
-
|
479
|
-
}
|
461
|
+
data.push(row)
|
462
|
+
};
|
480
463
|
report += table([columns].concat(data))
|
481
464
|
return report
|
482
465
|
}
|
@@ -484,12 +467,12 @@ let configStruct = {
|
|
484
467
|
{
|
485
468
|
where: where(),
|
486
469
|
match: ({context}) => context.marker == 'answer' && context.paraphrase,
|
487
|
-
apply: ({
|
470
|
+
apply: ({context}) => `answer with ${context.type}`
|
488
471
|
},
|
489
472
|
{
|
490
473
|
where: where(),
|
491
474
|
match: ({context}) => context.marker == 'answer' && !context.paraphrase,
|
492
|
-
apply: ({
|
475
|
+
apply: ({context}) => `answering with ${context.type}`
|
493
476
|
},
|
494
477
|
],
|
495
478
|
|
@@ -498,13 +481,13 @@ let configStruct = {
|
|
498
481
|
where: where(),
|
499
482
|
notes: 'handle show semantic',
|
500
483
|
match: ({context}) => context.marker == 'show',
|
501
|
-
apply: ({context, e, km, kms, apis, insert, config, objects}) => {
|
484
|
+
apply: async ({context, e, km, kms, apis, insert, config, objects}) => {
|
502
485
|
if (context.report) {
|
503
486
|
const values = propertyToArray(context.report)
|
504
487
|
const responses = []
|
505
488
|
for (let value of values) {
|
506
489
|
if (!value.value || value.pullFromContext) {
|
507
|
-
value = e(value)
|
490
|
+
value = await e(value)
|
508
491
|
}
|
509
492
|
let id = value.value
|
510
493
|
if (value.evalue) {
|
@@ -527,7 +510,7 @@ let configStruct = {
|
|
527
510
|
}
|
528
511
|
context.isResponse = true
|
529
512
|
} else {
|
530
|
-
const report = e(context.on)
|
513
|
+
const report = await e(context.on)
|
531
514
|
const id = report.value.value
|
532
515
|
const listing = objects.listings[id]
|
533
516
|
const values = propertyToArray(context.properties)
|
@@ -550,11 +533,11 @@ let configStruct = {
|
|
550
533
|
notes: 'get the report data',
|
551
534
|
where: where(),
|
552
535
|
match: ({context}) => context.marker == 'listAction',
|
553
|
-
apply: ({context, e, objects, apis, km, config}) => {
|
536
|
+
apply: async ({context, e, objects, apis, km, config}) => {
|
554
537
|
//const name = '***current***'
|
555
538
|
if (context.api) {
|
556
539
|
// id = newReport({km, objects})
|
557
|
-
const report = e({ marker: 'report', pullFromContext: true })
|
540
|
+
const report = await e({ marker: 'report', pullFromContext: true })
|
558
541
|
const id = report.value.value
|
559
542
|
const listing = objects.listings[id]
|
560
543
|
listing.api = context.api
|
@@ -562,7 +545,7 @@ let configStruct = {
|
|
562
545
|
context.id = id
|
563
546
|
context.listing = apis[listing.api].getAllProducts(listing)
|
564
547
|
} else {
|
565
|
-
const report = e({ marker: 'report', pullFromContext: true })
|
548
|
+
const report = await e({ marker: 'report', pullFromContext: true })
|
566
549
|
const id = report.evalue.value
|
567
550
|
const listing = objects.listings[id]
|
568
551
|
const api = apis[listing.api]
|
@@ -572,16 +555,16 @@ let configStruct = {
|
|
572
555
|
context.isResponse = true
|
573
556
|
},
|
574
557
|
},
|
575
|
-
|
576
|
-
({context}) => context.marker == 'answer',
|
577
|
-
({e, context, objects, kms, insert}) => {
|
578
|
-
const report = e({ marker: 'report', pullFromContext: true })
|
558
|
+
{
|
559
|
+
match: ({context}) => context.marker == 'answer',
|
560
|
+
apply: async ({e, context, objects, kms, insert}) => {
|
561
|
+
const report = await e({ marker: 'report', pullFromContext: true })
|
579
562
|
const id = report.value.value
|
580
563
|
const listing = objects.listings[id]
|
581
564
|
listing.type = context.type
|
582
565
|
kms.events.api.happens(insert, { marker: "changes", level: 1, changeable: { marker: 'report', pullFromContext: true } })
|
583
566
|
}
|
584
|
-
|
567
|
+
},
|
585
568
|
],
|
586
569
|
};
|
587
570
|
|
@@ -616,7 +599,7 @@ const createConfig = async () => {
|
|
616
599
|
// config.addAPI(api1)
|
617
600
|
// config.addAPI(api2)
|
618
601
|
}
|
619
|
-
config.initializer(({config, objects, km, isModule}) => {
|
602
|
+
await config.initializer(({config, objects, km, isModule}) => {
|
620
603
|
objects.tempReportId = 0
|
621
604
|
objects.listings = {
|
622
605
|
}
|
package/common/scorekeeper.js
CHANGED
@@ -122,36 +122,29 @@ let configStruct = {
|
|
122
122
|
{
|
123
123
|
where: where(),
|
124
124
|
match: ({context, hierarchy}) => hierarchy.isA(context.marker, 'is') && context.isResponse && context.two && context.two.marker == 'next',
|
125
|
-
apply: ({context, g}) => {
|
125
|
+
apply: async ({context, g}) => {
|
126
126
|
const response = context.evalue;
|
127
127
|
const concept = response.two;
|
128
128
|
concept.paraphrase = true
|
129
129
|
concept.isSelf = true
|
130
|
-
const instance = g(concept.evalue)
|
130
|
+
const instance = await g(concept.evalue)
|
131
131
|
return instance
|
132
132
|
}
|
133
133
|
},
|
134
134
|
{
|
135
135
|
where: where(),
|
136
136
|
match: ({context}) => context.marker == 'point' && context.isResponse && context.amount,
|
137
|
-
apply: ({context, g}) => `${g(context.amount)} points`
|
137
|
+
apply: async ({context, g}) => `${await g(context.amount)} points`
|
138
138
|
},
|
139
139
|
{
|
140
140
|
where: where(),
|
141
141
|
match: ({context}) => context.marker == 'scored' && context.paraphrase,
|
142
|
-
apply: ({context, g}) => `${g(context.player)} got ${g(context.points)}`
|
142
|
+
apply: async ({context, g}) => `${await g(context.player)} got ${await g(context.points)}`
|
143
143
|
},
|
144
|
-
/*
|
145
|
-
{
|
146
|
-
where: where(),
|
147
|
-
match: ({context}) => context.marker == 'enumeration' && context.paraphrase,
|
148
|
-
apply: ({context, g}) => `${g(context.concept)} are ${g(context.items)}`
|
149
|
-
},
|
150
|
-
*/
|
151
144
|
{
|
152
145
|
where: where(),
|
153
146
|
match: ({context}) => context.marker == 'start' && context.paraphrase,
|
154
|
-
apply: ({context, g}) => `start ${g(context.arg)}`
|
147
|
+
apply: async ({context, g}) => `start ${await g(context.arg)}`
|
155
148
|
},
|
156
149
|
|
157
150
|
],
|
@@ -161,7 +154,6 @@ let configStruct = {
|
|
161
154
|
where: where(),
|
162
155
|
match: ({context}) => context.marker == 'player' && context.same,
|
163
156
|
apply: ({context, objects, config, km}) => {
|
164
|
-
//objects.players = context.same.value.map( (props) => props.value )
|
165
157
|
const players = context.same.value.map( (props) => props.value )
|
166
158
|
setPlayers(objects, config, players)
|
167
159
|
for (let player of objects.players) {
|
@@ -205,11 +197,11 @@ let configStruct = {
|
|
205
197
|
matchq: ({objects}) => objects.players.length == 0,
|
206
198
|
applyq: () => 'who are the players?',
|
207
199
|
matchr: ({context}) => context.marker == 'list',
|
208
|
-
applyr: ({context, gs, objects, config}) => {
|
200
|
+
applyr: async ({context, gs, objects, config}) => {
|
209
201
|
const players = context.value.map( (player) => player.value )
|
210
202
|
setPlayers(objects, config, players)
|
211
203
|
objects.allPlayersAreKnown = true;
|
212
|
-
context.verbatim = `The players are ${gs(objects.players, ' ', ' and ')}`
|
204
|
+
context.verbatim = `The players are ${await gs(objects.players, ' ', ' and ')}`
|
213
205
|
context.isResponse = true;
|
214
206
|
}
|
215
207
|
}
|
@@ -242,12 +234,12 @@ let configStruct = {
|
|
242
234
|
{
|
243
235
|
where: where(),
|
244
236
|
match: ({context}) => context.marker == 'player' && context.evaluate && context.pullFromContext,
|
245
|
-
apply: ({context, objects, gs}) => {
|
237
|
+
apply: async ({context, objects, gs}) => {
|
246
238
|
const players = objects.players
|
247
239
|
if (players.length == 0) {
|
248
240
|
context.evalue = 'no one'
|
249
241
|
} else {
|
250
|
-
context.evalue = gs(players, ' ', ' and ')
|
242
|
+
context.evalue = await gs(players, ' ', ' and ')
|
251
243
|
}
|
252
244
|
}
|
253
245
|
},
|
@@ -354,7 +346,7 @@ const createConfig = async () => {
|
|
354
346
|
const config = new Config(configStruct, module)
|
355
347
|
config.stop_auto_rebuild()
|
356
348
|
await config.add(dialogues, numbers, properties)
|
357
|
-
config.initializer( ({objects, km, isModule}) => {
|
349
|
+
await config.initializer( ({objects, km, isModule}) => {
|
358
350
|
objects.players = []
|
359
351
|
objects.nextPlayer = undefined;
|
360
352
|
setNextPlayer(km, objects);
|
package/common/sdefaults.js
CHANGED
@@ -12,10 +12,10 @@ let configStruct = {
|
|
12
12
|
// match: ({context}) => context.flatten || context.listable && context.value[0].flatten,
|
13
13
|
match: ({context}) => context.flatten || context.listable && context.value.some((value) => value.flatten),
|
14
14
|
// match: ({context}) => context.flatten || context.listable || (Array.isArray(context.value) && context.value.some((value) => value.flatten)),
|
15
|
-
apply: ({config, km, context, s}) => {
|
15
|
+
apply: async ({config, km, context, s}) => {
|
16
16
|
const [flats, wf] = flatten(['list'], context)
|
17
17
|
for (let flat of flats) {
|
18
|
-
s({ ...flat, flatten: false })
|
18
|
+
await s({ ...flat, flatten: false })
|
19
19
|
}
|
20
20
|
}
|
21
21
|
},
|
@@ -24,8 +24,8 @@ let configStruct = {
|
|
24
24
|
where: where(),
|
25
25
|
priority: -1,
|
26
26
|
match: ({context}) => context.semanticIsEvaluate,
|
27
|
-
apply: ({context, e}) => {
|
28
|
-
context.value = e({ ...context, semanticIsEvaluate: false })
|
27
|
+
apply: async ({context, e}) => {
|
28
|
+
context.value = await e({ ...context, semanticIsEvaluate: false })
|
29
29
|
context.isResponse
|
30
30
|
}
|
31
31
|
},
|
package/common/stm.js
CHANGED
@@ -103,7 +103,7 @@ let createConfig = async () => {
|
|
103
103
|
const config = new Config({ name: 'stm' }, module)
|
104
104
|
config.stop_auto_rebuild()
|
105
105
|
|
106
|
-
config.initializer( ({config}) => {
|
106
|
+
await config.initializer( ({config}) => {
|
107
107
|
config.addArgs(({kms}) => ({
|
108
108
|
mentioned: (context) => {
|
109
109
|
kms.stm.api.mentioned(context)
|
package/common/tell.js
CHANGED
@@ -66,25 +66,25 @@ let configStruct = {
|
|
66
66
|
{
|
67
67
|
where: where(),
|
68
68
|
match: ({context}) => context.marker == 'tell',
|
69
|
-
apply: ({context, g}) => `tell ${g(context.target)} ${g(context.info.info)} ${g(context.event)}`
|
69
|
+
apply: async ({context, g}) => `tell ${await g(context.target)} ${await g(context.info.info)} ${await g(context.event)}`
|
70
70
|
},
|
71
71
|
{
|
72
72
|
where: where(),
|
73
73
|
match: ({context}) => context.marker == 'info',
|
74
|
-
apply: ({context
|
74
|
+
apply: ({context}) => context.info
|
75
75
|
},
|
76
76
|
{
|
77
77
|
where: where(),
|
78
78
|
match: ({context}) => context.marker == 'event' && context.paraphrase,
|
79
|
-
apply: ({context
|
79
|
+
apply: ({context}) => 'event'
|
80
80
|
},
|
81
81
|
],
|
82
82
|
semantics: [
|
83
83
|
{
|
84
84
|
where: where(),
|
85
85
|
match: ({context, hierarchy}) => !context.happening && hierarchy.isA(context.marker, 'tell'),
|
86
|
-
apply: ({context, api,
|
87
|
-
const result = config.processContext({ ...context.event, happening: true })
|
86
|
+
apply: async ({context, api, config}) => {
|
87
|
+
const result = await config.processContext({ ...context.event, happening: true })
|
88
88
|
const event = result.context.event
|
89
89
|
if (event) {
|
90
90
|
event.then( (result) => {
|
@@ -103,7 +103,7 @@ const createConfig = async () => {
|
|
103
103
|
config.stop_auto_rebuild()
|
104
104
|
await config.setApi(api)
|
105
105
|
await config.add(dialogues)
|
106
|
-
config.initializer( ({config, isModule}) => {
|
106
|
+
await config.initializer( ({config, isModule}) => {
|
107
107
|
if (!isModule) {
|
108
108
|
config.addSemantic({
|
109
109
|
match: ({context, hierarchy}) => context.happening && hierarchy.isA(context.marker, 'event'),
|
@@ -5239,48 +5239,6 @@
|
|
5239
5239
|
0
|
5240
5240
|
]
|
5241
5241
|
],
|
5242
|
-
[
|
5243
|
-
[
|
5244
|
-
"celcius",
|
5245
|
-
0
|
5246
|
-
],
|
5247
|
-
[
|
5248
|
-
"divideByOperator",
|
5249
|
-
0
|
5250
|
-
],
|
5251
|
-
[
|
5252
|
-
"equals",
|
5253
|
-
0
|
5254
|
-
],
|
5255
|
-
[
|
5256
|
-
"fahrenheit",
|
5257
|
-
0
|
5258
|
-
],
|
5259
|
-
[
|
5260
|
-
"leftParenthesis",
|
5261
|
-
0
|
5262
|
-
],
|
5263
|
-
[
|
5264
|
-
"minusOperator",
|
5265
|
-
0
|
5266
|
-
],
|
5267
|
-
[
|
5268
|
-
"number",
|
5269
|
-
0
|
5270
|
-
],
|
5271
|
-
[
|
5272
|
-
"plusOperator",
|
5273
|
-
0
|
5274
|
-
],
|
5275
|
-
[
|
5276
|
-
"rightParenthesis",
|
5277
|
-
0
|
5278
|
-
],
|
5279
|
-
[
|
5280
|
-
"timesOperator",
|
5281
|
-
0
|
5282
|
-
]
|
5283
|
-
],
|
5284
5242
|
[
|
5285
5243
|
[
|
5286
5244
|
"celcius",
|
@@ -5576,48 +5534,6 @@
|
|
5576
5534
|
0
|
5577
5535
|
]
|
5578
5536
|
],
|
5579
|
-
[
|
5580
|
-
[
|
5581
|
-
"celcius",
|
5582
|
-
0
|
5583
|
-
],
|
5584
|
-
[
|
5585
|
-
"divideByOperator",
|
5586
|
-
0
|
5587
|
-
],
|
5588
|
-
[
|
5589
|
-
"equals",
|
5590
|
-
0
|
5591
|
-
],
|
5592
|
-
[
|
5593
|
-
"fahrenheit",
|
5594
|
-
0
|
5595
|
-
],
|
5596
|
-
[
|
5597
|
-
"leftParenthesis",
|
5598
|
-
0
|
5599
|
-
],
|
5600
|
-
[
|
5601
|
-
"minusOperator",
|
5602
|
-
0
|
5603
|
-
],
|
5604
|
-
[
|
5605
|
-
"number",
|
5606
|
-
0
|
5607
|
-
],
|
5608
|
-
[
|
5609
|
-
"plusOperator",
|
5610
|
-
0
|
5611
|
-
],
|
5612
|
-
[
|
5613
|
-
"rightParenthesis",
|
5614
|
-
0
|
5615
|
-
],
|
5616
|
-
[
|
5617
|
-
"timesOperator",
|
5618
|
-
0
|
5619
|
-
]
|
5620
|
-
],
|
5621
5537
|
[
|
5622
5538
|
[
|
5623
5539
|
"celcius",
|
package/common/testing.js
CHANGED
@@ -13,9 +13,9 @@ let configStruct = {
|
|
13
13
|
{
|
14
14
|
where: where(),
|
15
15
|
id: 'testingEvaluate',
|
16
|
-
generatorp: ({context, g}) => `${context.word} ${g(context.value)}`,
|
17
|
-
semantic: ({context, e}) => {
|
18
|
-
context.evalue = e(context.value)
|
16
|
+
generatorp: async ({context, g}) => `${context.word} ${await g(context.value)}`,
|
17
|
+
semantic: async ({context, e}) => {
|
18
|
+
context.evalue = await e(context.value)
|
19
19
|
context.isResponse = true
|
20
20
|
},
|
21
21
|
bridge: "{ ...next(operator), value: after[0] }",
|
package/common/time.js
CHANGED
@@ -103,12 +103,12 @@ const configStruct = {
|
|
103
103
|
{
|
104
104
|
where: where(),
|
105
105
|
match: ({context}) => context.marker == 'ampm' && context.paraphrase,
|
106
|
-
apply: ({g, context, gp}) => `${gp(context.hour)} ${context.ampm}`
|
106
|
+
apply: async ({g, context, gp}) => `${await gp(context.hour)} ${context.ampm}`
|
107
107
|
},
|
108
108
|
{
|
109
109
|
where: where(),
|
110
110
|
match: ({context}) => context.marker == 'time' && context.evalue && context.format == 12,
|
111
|
-
apply: ({
|
111
|
+
apply: ({context}) => {
|
112
112
|
let hh = context.evalue.getHours();
|
113
113
|
let ampm = 'am'
|
114
114
|
if (hh > 12) {
|
@@ -175,7 +175,7 @@ const createConfig = async () => {
|
|
175
175
|
config.stop_auto_rebuild()
|
176
176
|
await config.add(tell, numbers, countable)
|
177
177
|
await config.setApi(api)
|
178
|
-
config.initializer( ({config, objects, kms, isModule}) => {
|
178
|
+
await config.initializer( ({config, objects, kms, isModule}) => {
|
179
179
|
if (!isModule) {
|
180
180
|
kms.time.api.newDate = () => new Date("December 25, 1995 1:59:58 pm" )
|
181
181
|
}
|
package/common/ui.js
CHANGED
@@ -58,7 +58,7 @@ const configStruct = {
|
|
58
58
|
{
|
59
59
|
where: where(),
|
60
60
|
match: ({context, isA}) => isA(context, 'direction'),
|
61
|
-
apply: ({context, insert, s, fragments}) => {
|
61
|
+
apply: async ({context, insert, s, fragments}) => {
|
62
62
|
const direction = context
|
63
63
|
const fragment = fragments("move direction")
|
64
64
|
const mappings = [{
|
@@ -66,8 +66,8 @@ const configStruct = {
|
|
66
66
|
match: ({context}) => context.value == 'direction',
|
67
67
|
apply: ({context}) => Object.assign(context, direction),
|
68
68
|
}]
|
69
|
-
const instantiation = fragment.instantiate(mappings)
|
70
|
-
s(instantiation)
|
69
|
+
const instantiation = await fragment.instantiate(mappings)
|
70
|
+
await s(instantiation)
|
71
71
|
}
|
72
72
|
},
|
73
73
|
],
|
@@ -117,7 +117,7 @@ const configStruct = {
|
|
117
117
|
isA: ['verby'],
|
118
118
|
level: 0,
|
119
119
|
bridge: "{ ...next(operator), action: after[0] }",
|
120
|
-
generatorp: ({context, g}) => `stop ${g(context.action)}`,
|
120
|
+
generatorp: async ({context, g}) => `stop ${await g(context.action)}`,
|
121
121
|
semantic: ({api, context}) => {
|
122
122
|
api.stop(context.action.value)
|
123
123
|
}
|
@@ -128,7 +128,7 @@ const configStruct = {
|
|
128
128
|
isA: ['verby'],
|
129
129
|
level: 0,
|
130
130
|
bridge: "{ ...next(operator), direction: after[0] }",
|
131
|
-
generatorp: ({context, g}) => `move ${g(context.direction)}`,
|
131
|
+
generatorp: async ({context, g}) => `move ${await g(context.direction)}`,
|
132
132
|
semantic: ({api, context}) => {
|
133
133
|
api.move(context.direction.value, context.direction.steps ? context.direction.steps.value : 1)
|
134
134
|
}
|
package/package.json
CHANGED
@@ -280,8 +280,8 @@
|
|
280
280
|
"table": "^6.7.1",
|
281
281
|
"base-64": "^1.0.0",
|
282
282
|
"argparse": "^2.0.1",
|
283
|
-
"theprogrammablemind": "8.0.0-beta.
|
283
|
+
"theprogrammablemind": "8.0.0-beta.23"
|
284
284
|
},
|
285
|
-
"version": "8.0.0-beta.
|
285
|
+
"version": "8.0.0-beta.23",
|
286
286
|
"license": "UNLICENSED"
|
287
287
|
}
|