tpmkms 7.12.4 → 7.12.5-beta.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.
@@ -41,6 +41,8 @@ let configStruct = {
41
41
  // "(([queryable]) [is:isEdBridge|is,are] ([isEdAble|]))",
42
42
  "(([queryable]) [(<isEd|> ([isEdAble|]))])",
43
43
 
44
+ "([nevermind])",
45
+ { pattern: "([nevermindTestSetup] (allowed))", development: true },
44
46
  "([why])",
45
47
  "([reason])",
46
48
  "([thisitthat|])",
@@ -131,6 +133,7 @@ let configStruct = {
131
133
  where: where(),
132
134
  id: "to",
133
135
  level: 0,
136
+ isA: ['preposition'],
134
137
  bridge: "{ ...next(operator), toObject: after[0] }",
135
138
  generatorp: ({context, gp}) => {
136
139
  return `to ${gp(context.toObject)}`
@@ -203,6 +206,44 @@ let configStruct = {
203
206
  before: ['verby'],
204
207
  bridge: "{ ...next(operator) }"
205
208
  },
209
+ {
210
+ id: "nevermind",
211
+ bridge: "{ ...next(operator) }",
212
+ semantic: (args) => {
213
+ const {config, context} = args
214
+ // stop asking all questions
215
+ for (const semantic of config.semantics) {
216
+ if (semantic.isQuestion) {
217
+ let doRemove = true
218
+ if (semantic.onNevermind && semantic.getWasAsked() && !semantic.getWasApplied()) {
219
+ doRemove = semantic.onNevermind(args)
220
+ }
221
+ if (doRemove) {
222
+ config.removeSemantic(semantic)
223
+ }
224
+ }
225
+ }
226
+ }
227
+ },
228
+ {
229
+ id: "nevermindTestSetup",
230
+ development: true,
231
+ bridge: "{ ...next(operator), type: after[0], postModifiers: ['type'] }",
232
+ semantic: ({ask, context}) => {
233
+ const nevermindType = context.type.value
234
+ ask({
235
+ applyq: () => 'the test question?',
236
+ onNevermind: ({objects, context}) => {
237
+ objects.onNevermindWasCalled = true
238
+ debugger
239
+ objects.nevermindType = nevermindType
240
+ return nevermindType == 'accept'
241
+ },
242
+ matchr: () => false,
243
+ applyr: () => {},
244
+ })
245
+ }
246
+ },
206
247
  {
207
248
  id: "why",
208
249
  level: 0,
@@ -569,8 +610,8 @@ let configStruct = {
569
610
  where: where(),
570
611
  notes: 'pull from context',
571
612
  // match: ({context}) => context.marker == 'it' && context.pullFromContext, // && context.value,
572
- match: ({context}) => context.pullFromContext && !context.same, // && context.value,
573
- apply: ({context, s, kms, e, log, retry}) => {
613
+ match: ({context, callId}) => context.pullFromContext && !context.same, // && context.value,
614
+ apply: ({callId, context, s, kms, e, log, retry}) => {
574
615
  if (true) {
575
616
  /*
576
617
  {
@@ -803,6 +844,7 @@ let configStruct = {
803
844
  {
804
845
  where: where(),
805
846
  notes: 'get variable from stm',
847
+ // match: ({context, kms}) => !context.determiner && context.evaluate && kms.stm.api.getVariable(context.value) != context.value,
806
848
  match: ({context, kms}) => context.evaluate && kms.stm.api.getVariable(context.value) != context.value,
807
849
  // match: ({context, kms}) => context.evaluate,
808
850
  priority: -1,
@@ -901,6 +943,7 @@ knowledgeModule( {
901
943
  name: './dialogues.test.json',
902
944
  contents: dialogues_tests,
903
945
  checks: {
946
+ objects: ['onNevermindWasCalled', 'nevermindType'],
904
947
  context: defaultContextCheck,
905
948
  },
906
949