tpmkms_4wp 8.0.0-beta.42 → 8.0.0-beta.44

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. package/common/animals.js +17 -20
  2. package/common/articles.js +6 -11
  3. package/common/avatar.js +5 -9
  4. package/common/characters.js +22 -26
  5. package/common/colors.instance.json +28 -0
  6. package/common/colors.js +4 -8
  7. package/common/comparable.js +5 -9
  8. package/common/concept.js +120 -124
  9. package/common/countable.js +5 -9
  10. package/common/crew.js +36 -41
  11. package/common/currency.js +25 -43
  12. package/common/dialogues.js +46 -49
  13. package/common/dimension.instance.json +8 -8
  14. package/common/dimension.js +7 -13
  15. package/common/edible.instance.json +112 -0
  16. package/common/edible.js +3 -8
  17. package/common/emotions.js +35 -38
  18. package/common/evaluate.js +5 -11
  19. package/common/events.js +6 -10
  20. package/common/fastfood.instance.json +401 -317
  21. package/common/fastfood.js +53 -63
  22. package/common/formulas.instance.json +10 -10
  23. package/common/formulas.js +7 -14
  24. package/common/gdefaults.js +8 -10
  25. package/common/help.js +7 -12
  26. package/common/hierarchy.js +8 -12
  27. package/common/javascript.js +7 -14
  28. package/common/kirk.js +5 -8
  29. package/common/length.js +4 -8
  30. package/common/listener.js +5 -11
  31. package/common/math.instance.json +16 -16
  32. package/common/math.js +6 -10
  33. package/common/meta.js +5 -22
  34. package/common/nameable.js +6 -13
  35. package/common/negation.js +5 -5
  36. package/common/numbers.js +5 -9
  37. package/common/ordering.instance.json +68 -0
  38. package/common/ordering.js +80 -86
  39. package/common/people.js +8 -12
  40. package/common/percentages.js +5 -9
  41. package/common/pipboy.instance.json +84 -28
  42. package/common/pipboy.js +7 -15
  43. package/common/pokemon.js +7 -20
  44. package/common/pos.js +4 -5
  45. package/common/pressure.js +4 -8
  46. package/common/properties.js +6 -12
  47. package/common/punctuation.js +5 -5
  48. package/common/reports.instance.json +1 -1
  49. package/common/reports.js +9 -14
  50. package/common/scorekeeper.js +8 -12
  51. package/common/sdefaults.js +4 -5
  52. package/common/sizeable.js +5 -9
  53. package/common/spock.js +5 -8
  54. package/common/stgame.js +18 -23
  55. package/common/stm.js +9 -15
  56. package/common/tell.js +9 -13
  57. package/common/temperature.instance.json +0 -112
  58. package/common/temperature.js +4 -8
  59. package/common/tester.js +1 -1
  60. package/common/testing.js +5 -9
  61. package/common/time.js +18 -23
  62. package/common/tokenize.js +4 -5
  63. package/common/ui.js +6 -12
  64. package/common/weight.js +4 -8
  65. package/common/yesno.js +5 -5
  66. package/package.json +2 -2
@@ -823,7 +823,7 @@
823
823
  }
824
824
  ]
825
825
  },
826
- "trace": "\n\n>>>>>>>>>>>>> Counter 1\n 0. price/0 (1, 1) - \"price\"\n {\n default: true\n marker: Operator(price/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 0, 'end': 4}\n text: \"price\"\n value: \"price\"\n word: \"price\"\n }\n 1. list/0 (1, 3) - \"and\"\n {\n default: true\n marker: Operator(list/0, PASS, [\"Selector(Bridge('{ ...next(operator), listable: true, isList: true, value: append(before, after) }'), , same/(), [Type(variable: 'type')]<==>[Type(variable: 'type')], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator), listable: true, isList: true, value: append(before, after) }')), variables({}) bridge(bridge))\n range: {'start': 6, 'end': 8}\n text: \"and\"\n word: \"and\"\n }\n 2. quantity/0 (1, 7) - \"quantity\"\n {\n default: true\n marker: Operator(quantity/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 10, 'end': 17}\n text: \"quantity\"\n value: \"quantity\"\n word: \"quantity\"\n }\n 3. is/0 (1, 9) - \"are\"\n {\n marker: Operator(is/0, [\"Selector(Bridge('{ ...next(operator), one: after[0], two: after[1], query: true }'), , []<==>[Type('queryable'), Type('queryable')], bridge(queryBridge))\", \"Selector(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }'), , [Type('queryable')]<==>[Type('queryable')], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }')), variables({}) bridge(bridge))\n number: \"many\"\n range: {'start': 19, 'end': 21}\n text: \"are\"\n word: \"are\"\n }\n 4. property/0 (1, 15) - \"properties\"\n {\n marker: Operator(property/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 23, 'end': 32}\n text: \"properties\"\n value: \"property\"\n word: \"properties\"\n }\n<<<<<<<<<<<<<\nNext Op (index=0) is Context({default: True, marker: Operator(price/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge)), range: {'start': 0, 'end': 4}, text: price, value: price, word: price})\n\n>>>>>>>>>>>>> Counter 2\n *0. price/1 (dead) (2, 0) - \"price\"\n {\n dead: true\n default: true\n marker: Operator(price/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n range: {'start': 0, 'end': 4}\n text: \"price\"\n value: \"price\"\n word: \"price\"\n }\n 1. list/0 (1, 3) - \"and\"\n {\n default: true\n marker: Operator(list/0, PASS, [\"Selector(Bridge('{ ...next(operator), listable: true, isList: true, value: append(before, after) }'), , same/(), [Type(variable: 'type')]<==>[Type(variable: 'type')], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator), listable: true, isList: true, value: append(before, after) }')), variables({'type': ['property', 'theAble', 'object', 'queryable', 'quantity', 'hierarchyAble', 'number', 'unknown', 'quantifier']}) bridge(bridge))\n range: {'start': 6, 'end': 8}\n text: \"and\"\n types: [\n ]\n word: \"and\"\n }\n 2. quantity/0 (1, 7) - \"quantity\"\n {\n default: true\n marker: Operator(quantity/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 10, 'end': 17}\n text: \"quantity\"\n value: \"quantity\"\n word: \"quantity\"\n }\n 3. is/0 (1, 9) - \"are\"\n {\n marker: Operator(is/0, [\"Selector(Bridge('{ ...next(operator), one: after[0], two: after[1], query: true }'), , []<==>[Type('queryable'), Type('queryable')], bridge(queryBridge))\", \"Selector(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }'), , [Type('queryable')]<==>[Type('queryable')], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }')), variables({}) bridge(bridge))\n number: \"many\"\n range: {'start': 19, 'end': 21}\n text: \"are\"\n word: \"are\"\n }\n 4. property/0 (1, 15) - \"properties\"\n {\n marker: Operator(property/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 23, 'end': 32}\n text: \"properties\"\n value: \"property\"\n word: \"properties\"\n }\n<<<<<<<<<<<<<\nNext Op (index=1) is Context({default: True, marker: Operator(list/0, PASS, [\"Selector(Bridge('{ ...next(operator), listable: true, isList: true, value: append(before, after) }'), , same/(), [Type(variable: 'type')]<==>[Type(variable: 'type')], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator), listable: true, isList: true, value: append(before, after) }')), variables({'type': ['property', 'theAble', 'object', 'queryable', 'quantity', 'hierarchyAble', 'number', 'unknown', 'quantifier']}) bridge(bridge)), range: {'start': 6, 'end': 8}, text: and, types: [], word: and})\n\n>>>>>>>>>>>>> Counter 3\n *0. list/1 (3, 0) - \"price and quantity\"\n {\n default: true\n isList: true\n listable: true\n marker: Operator(list/1, PASS, ['Selector(Bridge(\\'{ ...operator, value: append(before, operator.value) }\\'), , same/(), [And([\"Type(variable: \\'type\\')\", \"Listable(Unify(Property((\\'context\\', \\'instance\\')), Property((\\'variables\\', \\'instance\\'))))\"])]<==>[], bridge(bridge), passthrough)'], evaluator(Bridge('{ ...operator, value: append(before, operator.value) }')), variables({'type': ['property', 'theAble', 'object', 'queryable', 'quantity', 'hierarchyAble', 'number', 'unknown', 'quantifier']}) bridge(bridge))\n range: {'start': 0, 'end': 17}\n text: \"price and quantity\"\n types: [\n ]\n value: [\n {\n dead: true\n default: true\n marker: Operator(price/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n range: {'start': 0, 'end': 4}\n text: \"price\"\n value: \"price\"\n word: \"price\"\n }\n\n {\n default: true\n marker: Operator(quantity/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 10, 'end': 17}\n text: \"quantity\"\n value: \"quantity\"\n word: \"quantity\"\n }\n ]\n word: \"and\"\n }\n 1. is/0 (1, 9) - \"are\"\n {\n marker: Operator(is/0, [\"Selector(Bridge('{ ...next(operator), one: after[0], two: after[1], query: true }'), , []<==>[Type('queryable'), Type('queryable')], bridge(queryBridge))\", \"Selector(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }'), , [Type('queryable')]<==>[Type('queryable')], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }')), variables({}) bridge(bridge))\n number: \"many\"\n range: {'start': 19, 'end': 21}\n text: \"are\"\n word: \"are\"\n }\n 2. property/0 (1, 15) - \"properties\"\n {\n marker: Operator(property/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 23, 'end': 32}\n text: \"properties\"\n value: \"property\"\n word: \"properties\"\n }\n<<<<<<<<<<<<<\nNext Op (index=2) is Context({marker: Operator(property/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge)), range: {'start': 23, 'end': 32}, text: properties, value: property, word: properties})\n\n>>>>>>>>>>>>> Counter 4\n 0. list/1 (3, 0) - \"price and quantity\"\n {\n default: true\n isList: true\n listable: true\n marker: Operator(list/1, PASS, ['Selector(Bridge(\\'{ ...operator, value: append(before, operator.value) }\\'), , same/(), [And([\"Type(variable: \\'type\\')\", \"Listable(Unify(Property((\\'context\\', \\'instance\\')), Property((\\'variables\\', \\'instance\\'))))\"])]<==>[], bridge(bridge), passthrough)'], evaluator(Bridge('{ ...operator, value: append(before, operator.value) }')), variables({'type': ['property', 'theAble', 'object', 'queryable', 'quantity', 'hierarchyAble', 'number', 'unknown', 'quantifier']}) bridge(bridge))\n range: {'start': 0, 'end': 17}\n text: \"price and quantity\"\n types: [\n ]\n value: [\n {\n dead: true\n default: true\n marker: Operator(price/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n range: {'start': 0, 'end': 4}\n text: \"price\"\n value: \"price\"\n word: \"price\"\n }\n\n {\n default: true\n marker: Operator(quantity/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 10, 'end': 17}\n text: \"quantity\"\n value: \"quantity\"\n word: \"quantity\"\n }\n ]\n word: \"and\"\n }\n 1. is/0 (1, 9) - \"are\"\n {\n marker: Operator(is/0, [\"Selector(Bridge('{ ...next(operator), one: after[0], two: after[1], query: true }'), , []<==>[Type('queryable'), Type('queryable')], bridge(queryBridge))\", \"Selector(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }'), , [Type('queryable')]<==>[Type('queryable')], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }')), variables({}) bridge(bridge))\n number: \"many\"\n range: {'start': 19, 'end': 21}\n text: \"are\"\n word: \"are\"\n }\n *2. property/1 (dead) (2, 1) - \"properties\"\n {\n dead: true\n marker: Operator(property/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n range: {'start': 23, 'end': 32}\n text: \"properties\"\n value: \"property\"\n word: \"properties\"\n }\n<<<<<<<<<<<<<\nNext Op (index=1) is Context({marker: Operator(is/0, [\"Selector(Bridge('{ ...next(operator), one: after[0], two: after[1], query: true }'), , []<==>[Type('queryable'), Type('queryable')], bridge(queryBridge))\", \"Selector(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }'), , [Type('queryable')]<==>[Type('queryable')], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }')), variables({}) bridge(bridge)), number: many, range: {'start': 19, 'end': 21}, text: are, word: are})\n\n>>>>>>>>>>>>> Counter 5\n *0. is/1 (4, 0) - \"price and quantity are properties\"\n {\n marker: Operator(is/1, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n number: \"many\"\n one: {\n default: true\n isList: true\n listable: true\n marker: Operator(list/1, PASS, ['Selector(Bridge(\\'{ ...operator, value: append(before, operator.value) }\\'), , same/(), [And([\"Type(variable: \\'type\\')\", \"Listable(Unify(Property((\\'context\\', \\'instance\\')), Property((\\'variables\\', \\'instance\\'))))\"])]<==>[], bridge(bridge), passthrough)'], evaluator(Bridge('{ ...operator, value: append(before, operator.value) }')), variables({'type': ['property', 'theAble', 'object', 'queryable', 'quantity', 'hierarchyAble', 'number', 'unknown', 'quantifier']}) bridge(bridge))\n number: \"many\"\n range: {'start': 0, 'end': 32}\n text: \"price and quantity\"\n types: [\n 'price'\n ]\n value: [\n {\n dead: true\n default: true\n marker: Operator(price/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n range: {'start': 0, 'end': 4}\n text: \"price\"\n value: \"price\"\n word: \"price\"\n }\n\n {\n default: true\n marker: Operator(quantity/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 10, 'end': 17}\n text: \"quantity\"\n value: \"quantity\"\n word: \"quantity\"\n }\n ]\n word: \"and\"\n }\n\n range: {'start': 0, 'end': 32}\n text: \"price and quantity are properties\"\n two: {\n dead: true\n marker: Operator(property/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n range: {'start': 23, 'end': 32}\n text: \"properties\"\n types: [\n 'property'\n ]\n value: \"property\"\n word: \"properties\"\n }\n\n word: \"are\"\n }\n<<<<<<<<<<<<<\nNext Op (index=0) is Context({marker: Operator(is/1, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge)), number: many, one: Context({default: True, isList: True, listable: True, marker: Operator(list/1, PASS, ['Selector(Bridge(\\'{ ...operator, value: append(before, operator.value) }\\'), , same/(), [And([\"Type(variable: \\'type\\')\", \"Listable(Unify(Property((\\'context\\', \\'instance\\')), Property((\\'variables\\', \\'instance\\'))))\"])]<==>[], bridge(bridge), passthrough)'], evaluator(Bridge('{ ...operator, value: append(before, operator.value) }')), variables({'type': ['property', 'theAble', 'object', 'queryable', 'quantity', 'hierarchyAble', 'number', 'unknown', 'quantifier']}) bridge(bridge)), number: many, range: {'start': 0, 'end': 32}, text: price and quantity, types: ['price'], value: [Context({dead: True, default: True, marker: Operator(price/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge)), range: {'start': 0, 'end': 4}, text: price, value: price, word: price}), Context({default: True, marker: Operator(quantity/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge)), range: {'start': 10, 'end': 17}, text: quantity, value: quantity, word: quantity})], word: and}), range: {'start': 0, 'end': 32}, text: price and quantity are properties, two: Context({dead: True, marker: Operator(property/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge)), range: {'start': 23, 'end': 32}, text: properties, types: ['property'], value: property, word: properties}), word: are})\n\n>>>>>>>>>>>>> Counter 6\n *0. is/2 (dead) (5, 0) - \"price and quantity are properties\"\n {\n dead: true\n marker: Operator(is/2, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n number: \"many\"\n one: {\n default: true\n isList: true\n listable: true\n marker: Operator(list/1, PASS, ['Selector(Bridge(\\'{ ...operator, value: append(before, operator.value) }\\'), , same/(), [And([\"Type(variable: \\'type\\')\", \"Listable(Unify(Property((\\'context\\', \\'instance\\')), Property((\\'variables\\', \\'instance\\'))))\"])]<==>[], bridge(bridge), passthrough)'], evaluator(Bridge('{ ...operator, value: append(before, operator.value) }')), variables({'type': ['property', 'theAble', 'object', 'queryable', 'quantity', 'hierarchyAble', 'number', 'unknown', 'quantifier']}) bridge(bridge))\n number: \"many\"\n range: {'start': 0, 'end': 32}\n text: \"price and quantity\"\n types: [\n 'price'\n ]\n value: [\n {\n dead: true\n default: true\n marker: Operator(price/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n range: {'start': 0, 'end': 4}\n text: \"price\"\n value: \"price\"\n word: \"price\"\n }\n\n {\n default: true\n marker: Operator(quantity/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 10, 'end': 17}\n text: \"quantity\"\n value: \"quantity\"\n word: \"quantity\"\n }\n ]\n word: \"and\"\n }\n\n range: {'start': 0, 'end': 32}\n text: \"price and quantity are properties\"\n two: {\n dead: true\n marker: Operator(property/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n range: {'start': 23, 'end': 32}\n text: \"properties\"\n types: [\n 'property'\n ]\n value: \"property\"\n word: \"properties\"\n }\n\n word: \"are\"\n }\n<<<<<<<<<<<<<\n",
826
+ "trace": "\n\n>>>>>>>>>>>>> Counter 1\n 0. price/0 (1, 1) - \"price\"\n {\n default: true\n marker: Operator(price/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 0, 'end': 4}\n text: \"price\"\n value: \"price\"\n word: \"price\"\n }\n 1. list/0 (1, 3) - \"and\"\n {\n default: true\n marker: Operator(list/0, PASS, [\"Selector(Bridge('{ ...next(operator), listable: true, isList: true, value: append(before, after) }'), , same/(), [Type(variable: 'type')]<==>[Type(variable: 'type')], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator), listable: true, isList: true, value: append(before, after) }')), variables({}) bridge(bridge))\n range: {'start': 6, 'end': 8}\n text: \"and\"\n word: \"and\"\n }\n 2. quantity/0 (1, 7) - \"quantity\"\n {\n default: true\n marker: Operator(quantity/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 10, 'end': 17}\n text: \"quantity\"\n value: \"quantity\"\n word: \"quantity\"\n }\n 3. is/0 (1, 9) - \"are\"\n {\n marker: Operator(is/0, [\"Selector(Bridge('{ ...next(operator), one: after[0], two: after[1], query: true }'), , []<==>[Type('queryable'), Type('queryable')], bridge(queryBridge))\", \"Selector(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }'), , [Type('queryable')]<==>[Type('queryable')], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }')), variables({}) bridge(bridge))\n number: \"many\"\n range: {'start': 19, 'end': 21}\n text: \"are\"\n word: \"are\"\n }\n 4. property/0 (1, 15) - \"properties\"\n {\n marker: Operator(property/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 23, 'end': 32}\n text: \"properties\"\n value: \"property\"\n word: \"properties\"\n }\n<<<<<<<<<<<<<\nNext Op (index=0) is Context({default: True, marker: Operator(price/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge)), range: {'start': 0, 'end': 4}, text: price, value: price, word: price})\n\n>>>>>>>>>>>>> Counter 2\n *0. price/1 (dead) (2, 0) - \"price\"\n {\n dead: true\n default: true\n marker: Operator(price/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n range: {'start': 0, 'end': 4}\n text: \"price\"\n value: \"price\"\n word: \"price\"\n }\n 1. list/0 (1, 3) - \"and\"\n {\n default: true\n marker: Operator(list/0, PASS, [\"Selector(Bridge('{ ...next(operator), listable: true, isList: true, value: append(before, after) }'), , same/(), [Type(variable: 'type')]<==>[Type(variable: 'type')], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator), listable: true, isList: true, value: append(before, after) }')), variables({'type': ['quantifier', 'queryable', 'object', 'quantity', 'theAble', 'hierarchyAble', 'number', 'unknown', 'property']}) bridge(bridge))\n range: {'start': 6, 'end': 8}\n text: \"and\"\n types: [\n ]\n word: \"and\"\n }\n 2. quantity/0 (1, 7) - \"quantity\"\n {\n default: true\n marker: Operator(quantity/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 10, 'end': 17}\n text: \"quantity\"\n value: \"quantity\"\n word: \"quantity\"\n }\n 3. is/0 (1, 9) - \"are\"\n {\n marker: Operator(is/0, [\"Selector(Bridge('{ ...next(operator), one: after[0], two: after[1], query: true }'), , []<==>[Type('queryable'), Type('queryable')], bridge(queryBridge))\", \"Selector(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }'), , [Type('queryable')]<==>[Type('queryable')], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }')), variables({}) bridge(bridge))\n number: \"many\"\n range: {'start': 19, 'end': 21}\n text: \"are\"\n word: \"are\"\n }\n 4. property/0 (1, 15) - \"properties\"\n {\n marker: Operator(property/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 23, 'end': 32}\n text: \"properties\"\n value: \"property\"\n word: \"properties\"\n }\n<<<<<<<<<<<<<\nNext Op (index=1) is Context({default: True, marker: Operator(list/0, PASS, [\"Selector(Bridge('{ ...next(operator), listable: true, isList: true, value: append(before, after) }'), , same/(), [Type(variable: 'type')]<==>[Type(variable: 'type')], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator), listable: true, isList: true, value: append(before, after) }')), variables({'type': ['quantifier', 'queryable', 'object', 'quantity', 'theAble', 'hierarchyAble', 'number', 'unknown', 'property']}) bridge(bridge)), range: {'start': 6, 'end': 8}, text: and, types: [], word: and})\n\n>>>>>>>>>>>>> Counter 3\n *0. list/1 (3, 0) - \"price and quantity\"\n {\n default: true\n isList: true\n listable: true\n marker: Operator(list/1, PASS, ['Selector(Bridge(\\'{ ...operator, value: append(before, operator.value) }\\'), , same/(), [And([\"Type(variable: \\'type\\')\", \"Listable(Unify(Property((\\'context\\', \\'instance\\')), Property((\\'variables\\', \\'instance\\'))))\"])]<==>[], bridge(bridge), passthrough)'], evaluator(Bridge('{ ...operator, value: append(before, operator.value) }')), variables({'type': ['quantifier', 'queryable', 'object', 'quantity', 'theAble', 'hierarchyAble', 'number', 'unknown', 'property']}) bridge(bridge))\n range: {'start': 0, 'end': 17}\n text: \"price and quantity\"\n types: [\n ]\n value: [\n {\n dead: true\n default: true\n marker: Operator(price/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n range: {'start': 0, 'end': 4}\n text: \"price\"\n value: \"price\"\n word: \"price\"\n }\n\n {\n default: true\n marker: Operator(quantity/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 10, 'end': 17}\n text: \"quantity\"\n value: \"quantity\"\n word: \"quantity\"\n }\n ]\n word: \"and\"\n }\n 1. is/0 (1, 9) - \"are\"\n {\n marker: Operator(is/0, [\"Selector(Bridge('{ ...next(operator), one: after[0], two: after[1], query: true }'), , []<==>[Type('queryable'), Type('queryable')], bridge(queryBridge))\", \"Selector(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }'), , [Type('queryable')]<==>[Type('queryable')], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }')), variables({}) bridge(bridge))\n number: \"many\"\n range: {'start': 19, 'end': 21}\n text: \"are\"\n word: \"are\"\n }\n 2. property/0 (1, 15) - \"properties\"\n {\n marker: Operator(property/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 23, 'end': 32}\n text: \"properties\"\n value: \"property\"\n word: \"properties\"\n }\n<<<<<<<<<<<<<\nNext Op (index=2) is Context({marker: Operator(property/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge)), range: {'start': 23, 'end': 32}, text: properties, value: property, word: properties})\n\n>>>>>>>>>>>>> Counter 4\n 0. list/1 (3, 0) - \"price and quantity\"\n {\n default: true\n isList: true\n listable: true\n marker: Operator(list/1, PASS, ['Selector(Bridge(\\'{ ...operator, value: append(before, operator.value) }\\'), , same/(), [And([\"Type(variable: \\'type\\')\", \"Listable(Unify(Property((\\'context\\', \\'instance\\')), Property((\\'variables\\', \\'instance\\'))))\"])]<==>[], bridge(bridge), passthrough)'], evaluator(Bridge('{ ...operator, value: append(before, operator.value) }')), variables({'type': ['quantifier', 'queryable', 'object', 'quantity', 'theAble', 'hierarchyAble', 'number', 'unknown', 'property']}) bridge(bridge))\n range: {'start': 0, 'end': 17}\n text: \"price and quantity\"\n types: [\n ]\n value: [\n {\n dead: true\n default: true\n marker: Operator(price/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n range: {'start': 0, 'end': 4}\n text: \"price\"\n value: \"price\"\n word: \"price\"\n }\n\n {\n default: true\n marker: Operator(quantity/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 10, 'end': 17}\n text: \"quantity\"\n value: \"quantity\"\n word: \"quantity\"\n }\n ]\n word: \"and\"\n }\n 1. is/0 (1, 9) - \"are\"\n {\n marker: Operator(is/0, [\"Selector(Bridge('{ ...next(operator), one: after[0], two: after[1], query: true }'), , []<==>[Type('queryable'), Type('queryable')], bridge(queryBridge))\", \"Selector(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }'), , [Type('queryable')]<==>[Type('queryable')], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }')), variables({}) bridge(bridge))\n number: \"many\"\n range: {'start': 19, 'end': 21}\n text: \"are\"\n word: \"are\"\n }\n *2. property/1 (dead) (2, 1) - \"properties\"\n {\n dead: true\n marker: Operator(property/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n range: {'start': 23, 'end': 32}\n text: \"properties\"\n value: \"property\"\n word: \"properties\"\n }\n<<<<<<<<<<<<<\nNext Op (index=1) is Context({marker: Operator(is/0, [\"Selector(Bridge('{ ...next(operator), one: after[0], two: after[1], query: true }'), , []<==>[Type('queryable'), Type('queryable')], bridge(queryBridge))\", \"Selector(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }'), , [Type('queryable')]<==>[Type('queryable')], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator), one: { number: operator.number, ...before[0] }, two: after[0] }')), variables({}) bridge(bridge)), number: many, range: {'start': 19, 'end': 21}, text: are, word: are})\n\n>>>>>>>>>>>>> Counter 5\n *0. is/1 (4, 0) - \"price and quantity are properties\"\n {\n marker: Operator(is/1, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n number: \"many\"\n one: {\n default: true\n isList: true\n listable: true\n marker: Operator(list/1, PASS, ['Selector(Bridge(\\'{ ...operator, value: append(before, operator.value) }\\'), , same/(), [And([\"Type(variable: \\'type\\')\", \"Listable(Unify(Property((\\'context\\', \\'instance\\')), Property((\\'variables\\', \\'instance\\'))))\"])]<==>[], bridge(bridge), passthrough)'], evaluator(Bridge('{ ...operator, value: append(before, operator.value) }')), variables({'type': ['quantifier', 'queryable', 'object', 'quantity', 'theAble', 'hierarchyAble', 'number', 'unknown', 'property']}) bridge(bridge))\n number: \"many\"\n range: {'start': 0, 'end': 32}\n text: \"price and quantity\"\n types: [\n 'price'\n ]\n value: [\n {\n dead: true\n default: true\n marker: Operator(price/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n range: {'start': 0, 'end': 4}\n text: \"price\"\n value: \"price\"\n word: \"price\"\n }\n\n {\n default: true\n marker: Operator(quantity/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 10, 'end': 17}\n text: \"quantity\"\n value: \"quantity\"\n word: \"quantity\"\n }\n ]\n word: \"and\"\n }\n\n range: {'start': 0, 'end': 32}\n text: \"price and quantity are properties\"\n two: {\n dead: true\n marker: Operator(property/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n range: {'start': 23, 'end': 32}\n text: \"properties\"\n types: [\n 'property'\n ]\n value: \"property\"\n word: \"properties\"\n }\n\n word: \"are\"\n }\n<<<<<<<<<<<<<\nNext Op (index=0) is Context({marker: Operator(is/1, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge)), number: many, one: Context({default: True, isList: True, listable: True, marker: Operator(list/1, PASS, ['Selector(Bridge(\\'{ ...operator, value: append(before, operator.value) }\\'), , same/(), [And([\"Type(variable: \\'type\\')\", \"Listable(Unify(Property((\\'context\\', \\'instance\\')), Property((\\'variables\\', \\'instance\\'))))\"])]<==>[], bridge(bridge), passthrough)'], evaluator(Bridge('{ ...operator, value: append(before, operator.value) }')), variables({'type': ['quantifier', 'queryable', 'object', 'quantity', 'theAble', 'hierarchyAble', 'number', 'unknown', 'property']}) bridge(bridge)), number: many, range: {'start': 0, 'end': 32}, text: price and quantity, types: ['price'], value: [Context({dead: True, default: True, marker: Operator(price/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge)), range: {'start': 0, 'end': 4}, text: price, value: price, word: price}), Context({default: True, marker: Operator(quantity/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge)), range: {'start': 10, 'end': 17}, text: quantity, value: quantity, word: quantity})], word: and}), range: {'start': 0, 'end': 32}, text: price and quantity are properties, two: Context({dead: True, marker: Operator(property/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge)), range: {'start': 23, 'end': 32}, text: properties, types: ['property'], value: property, word: properties}), word: are})\n\n>>>>>>>>>>>>> Counter 6\n *0. is/2 (dead) (5, 0) - \"price and quantity are properties\"\n {\n dead: true\n marker: Operator(is/2, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n number: \"many\"\n one: {\n default: true\n isList: true\n listable: true\n marker: Operator(list/1, PASS, ['Selector(Bridge(\\'{ ...operator, value: append(before, operator.value) }\\'), , same/(), [And([\"Type(variable: \\'type\\')\", \"Listable(Unify(Property((\\'context\\', \\'instance\\')), Property((\\'variables\\', \\'instance\\'))))\"])]<==>[], bridge(bridge), passthrough)'], evaluator(Bridge('{ ...operator, value: append(before, operator.value) }')), variables({'type': ['quantifier', 'queryable', 'object', 'quantity', 'theAble', 'hierarchyAble', 'number', 'unknown', 'property']}) bridge(bridge))\n number: \"many\"\n range: {'start': 0, 'end': 32}\n text: \"price and quantity\"\n types: [\n 'price'\n ]\n value: [\n {\n dead: true\n default: true\n marker: Operator(price/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n range: {'start': 0, 'end': 4}\n text: \"price\"\n value: \"price\"\n word: \"price\"\n }\n\n {\n default: true\n marker: Operator(quantity/0, [\"Selector(Bridge('{ ...next(operator) }'), , []<==>[], bridge(bridge))\"], evaluator(Bridge('{ ...next(operator) }')), variables({}) bridge(bridge))\n range: {'start': 10, 'end': 17}\n text: \"quantity\"\n value: \"quantity\"\n word: \"quantity\"\n }\n ]\n word: \"and\"\n }\n\n range: {'start': 0, 'end': 32}\n text: \"price and quantity are properties\"\n two: {\n dead: true\n marker: Operator(property/1, ['Selector(None, , []<==>[], bridge(bridge))'], evaluator(None), variables({}) bridge(bridge))\n range: {'start': 23, 'end': 32}\n text: \"properties\"\n types: [\n 'property'\n ]\n value: \"property\"\n word: \"properties\"\n }\n\n word: \"are\"\n }\n<<<<<<<<<<<<<\n",
827
827
  "contexts": [
828
828
  {
829
829
  "number": "many",
package/common/reports.js CHANGED
@@ -1,4 +1,4 @@
1
- const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const currencyKM = require('./currency.js')
4
4
  const events = require('./events.js')
@@ -110,7 +110,7 @@ const apiTemplate = (marker, testData) => {
110
110
  const api1 = apiTemplate('models', testData2)
111
111
  const api2 = apiTemplate('clothes', testData)
112
112
 
113
- let configStruct = {
113
+ let config = {
114
114
  name: 'reports',
115
115
  operators: [
116
116
  //"(([type]) [([(<less> ([than]))] ([amount]))])",
@@ -588,13 +588,7 @@ const initializeApi = (config, api, km) => {
588
588
  // config.addWord(type, {"id": "report", "initial": `${open} value: '${type}' ${close}` })
589
589
  }
590
590
 
591
- const createConfig = async () => {
592
- const config = new Config(configStruct, module)
593
- config.stop_auto_rebuild()
594
- await config.add(currencyKM, helpKM, math, events)
595
- await config.setMultiApi(initializeApi)
596
- // mode this to non-module init only
597
- await config.initializer(async ({config, objects, km, kms, isModule}) => {
591
+ const initializer = async ({config, objects, km, kms, isModule}) => {
598
592
  if (!isModule) {
599
593
  await kms.reports.addAPI(api1)
600
594
  await kms.reports.addAPI(api2)
@@ -606,15 +600,16 @@ const createConfig = async () => {
606
600
  if (!isModule) {
607
601
  objects.listings[id].api = 'clothes'
608
602
  }
609
- })
610
- await config.restart_auto_rebuild()
611
- return config
612
- }
603
+ }
613
604
 
614
605
  knowledgeModule({
606
+ config,
607
+ includes: [currencyKM, helpKM, math, events],
608
+ multiApiInitializer: initializeApi,
609
+ initializer,
610
+
615
611
  module,
616
612
  description: 'this module is for getting info about a concept with properties',
617
- createConfig,
618
613
  test: {
619
614
  name: './reports.test.json',
620
615
  contents: reports_tests,
@@ -1,4 +1,4 @@
1
- const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const dialogues = require('./dialogues')
4
4
  const numbers = require('./numbers')
@@ -51,7 +51,7 @@ const addPlayer = (objects, config, player) => {
51
51
  objects.players.push(player);
52
52
  }
53
53
 
54
- let configStruct = {
54
+ let config = {
55
55
  name: 'scorekeeper',
56
56
  operators: [
57
57
  "([next])",
@@ -342,21 +342,14 @@ let configStruct = {
342
342
  ],
343
343
  };
344
344
 
345
- const createConfig = async () => {
346
- const config = new Config(configStruct, module)
347
- config.stop_auto_rebuild()
348
- await config.add(dialogues, numbers, properties)
349
- await config.initializer( ({objects, km, isModule}) => {
345
+ const initializer = ({objects, km, isModule}) => {
350
346
  objects.players = []
351
347
  objects.nextPlayer = undefined;
352
348
  setNextPlayer(km, objects);
353
349
  objects.scores = {};
354
350
  objects.winningScore = null
355
351
  objects.allPlayersAreKnown = false;
356
- })
357
- await config.restart_auto_rebuild()
358
- return config
359
- }
352
+ }
360
353
 
361
354
  startWithDefault20 = [
362
355
  "greg got 1 point alice got 2 points greg got 1 point start a new game who is next",
@@ -374,9 +367,12 @@ startWithDefault20 = [
374
367
  ]
375
368
 
376
369
  knowledgeModule( {
370
+ config,
371
+ includes: [dialogues, numbers, properties],
372
+ initializer,
373
+
377
374
  module,
378
375
  description: 'scorekeeper for card or dice games',
379
- createConfig,
380
376
  test: {
381
377
  name: './scorekeeper.test.json',
382
378
  contents: scorekeeper_tests,
@@ -1,8 +1,8 @@
1
- const { Config, flatten, knowledgeModule, where } = require('./runtime').theprogrammablemind
1
+ const { flatten, knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const sdefaults_tests = require('./sdefaults.test.json')
4
4
 
5
- let configStruct = {
5
+ let config = {
6
6
  name: 'sdefaults',
7
7
  semantics: [
8
8
  {
@@ -32,12 +32,11 @@ let configStruct = {
32
32
  ],
33
33
  };
34
34
 
35
- const createConfig = async () => new Config(configStruct, module)
36
-
37
35
  knowledgeModule({
36
+ config,
37
+
38
38
  module,
39
39
  description: 'defaults for semantics',
40
- createConfig,
41
40
  test: {
42
41
  name: './sdefaults.test.json',
43
42
  contents: sdefaults_tests,
@@ -1,4 +1,4 @@
1
- const { Config, knowledgeModule, where, Digraph } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where, Digraph } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const dialogues = require("./hierarchy")
4
4
  const numbers = require("./numbers")
@@ -6,7 +6,7 @@ const sizeable_tests = require('./sizeable.test.json')
6
6
 
7
7
  // TODO 1 to 2 sizeables
8
8
 
9
- let configStruct = {
9
+ let config = {
10
10
  name: 'sizeable',
11
11
  operators: [
12
12
  "(([size|]) [sizing] ([sizeable]))",
@@ -52,16 +52,12 @@ let configStruct = {
52
52
  ]
53
53
  };
54
54
 
55
- const createConfig = async () => {
56
- const config = new Config(configStruct, module)
57
- await config.add(dialogues, numbers)
58
- return config
59
- }
60
-
61
55
  knowledgeModule({
56
+ config,
57
+ includes: [dialogues, numbers],
58
+
62
59
  module,
63
60
  description: 'Sizeable things',
64
- createConfig,
65
61
  test: {
66
62
  name: './sizeable.test.json',
67
63
  contents: sizeable_tests,
package/common/spock.js CHANGED
@@ -1,4 +1,4 @@
1
- const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const crew = require('./crew')
4
4
  const spock_tests = require('./spock.test.json')
@@ -10,18 +10,15 @@ const template = {
10
10
  ]
11
11
  };
12
12
 
13
- const createConfig = async () => {
14
- const config = new Config({ name: 'spock', }, module)
15
- await config.add(crew)
16
- return config
17
- }
18
-
19
13
  spock_instance.base = 'crew'
20
14
  // config.load(template, spock_instance)
15
+
21
16
  knowledgeModule( {
17
+ config: { name: 'spock', },
18
+ includes: [crew],
19
+
22
20
  module,
23
21
  description: 'Spock Simulator using a KM template',
24
- createConfig,
25
22
  test: {
26
23
  name: './spock.test.json',
27
24
  contents: spock_tests,
package/common/stgame.js CHANGED
@@ -1,4 +1,4 @@
1
- const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where, process : clientProcess } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const createCharacters = require('./characters')
4
4
  const stgame_tests = require('./stgame.test.json')
@@ -31,7 +31,8 @@ class KirkAPI {
31
31
 
32
32
  process(config, utterance) {
33
33
  this.kirk.server(config.getServer(), config.getAPIKey())
34
- return this.kirk.process(utterance, { credentials: this.credentials })
34
+ // return this.kirk.process(utterance, { credentials: this.credentials })
35
+ return clientProcess(this.kirk, utterance, { credentials: this.credentials })
35
36
  }
36
37
 
37
38
  response({km, context, result}) {
@@ -53,7 +54,8 @@ class SpockAPI {
53
54
 
54
55
  process(config, utterance) {
55
56
  this.spock.server(config.getServer(), config.getAPIKey())
56
- return this.spock.process(utterance, { credentials: this.credentials })
57
+ // return this.spock.process(utterance, { credentials: this.credentials })
58
+ return clientProcess(this.spock, utterance, { credentials: this.credentials })
57
59
  }
58
60
 
59
61
  response({km, context, result}) {
@@ -61,34 +63,27 @@ class SpockAPI {
61
63
  }
62
64
  }
63
65
 
66
+ const createCharactersHelper = async () => {
67
+ const characters = await createCharacters()
68
+ const kirk = await createKirk()
69
+ const spock = await createSpock()
70
+ await characters.setApi(new KirkAPI(kirk))
71
+ await characters.setApi(new SpockAPI(spock))
72
+ return characters
73
+ }
64
74
 
65
- const createConfig = async () => {
66
- const config = new Config({
75
+ knowledgeModule( {
76
+ config: {
67
77
  name: 'stgame',
68
78
  operators: [ "([a])" ],
69
79
  bridges: [ { id: 'a', level: 0, bridge: "{ ...next(operator) }" } ],
70
80
  words: {"?": [{"id": "a", "initial": "{}" }]},
71
- }, module)
72
-
73
- const createCharactersHelper = async () => {
74
- const characters = await createCharacters()
75
- const kirk = await createKirk()
76
- const spock = await createSpock()
77
- await characters.setApi(new KirkAPI(kirk))
78
- await characters.setApi(new SpockAPI(spock))
79
- return characters
80
- }
81
- config.stop_auto_rebuild()
82
- await config.setApi(api)
83
- await config.add(createCharactersHelper)
84
- await config.restart_auto_rebuild()
85
- return config
86
- }
81
+ },
82
+ api: () => api,
83
+ includes: [createCharactersHelper],
87
84
 
88
- knowledgeModule( {
89
85
  module,
90
86
  description: 'Game simulator for trek-like characters',
91
- createConfig,
92
87
  test: {
93
88
  name: './stgame.test.json',
94
89
  contents: stgame_tests,
package/common/stm.js CHANGED
@@ -1,4 +1,4 @@
1
- const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const helpers = require('./helpers')
4
4
  const articles = require('./articles')
@@ -174,7 +174,7 @@ class API {
174
174
 
175
175
  const api = new API()
176
176
 
177
- const configStruct = {
177
+ const config = {
178
178
  name: 'stm',
179
179
  operators: [
180
180
  "([stm_previous|previous] ([memorable]))",
@@ -241,11 +241,7 @@ const configStruct = {
241
241
  ],
242
242
  }
243
243
 
244
- let createConfig = async () => {
245
- const config = new Config(configStruct, module)
246
- config.stop_auto_rebuild()
247
-
248
- await config.initializer( ({config}) => {
244
+ const initializer = ({config}) => {
249
245
  config.addArgs(({kms}) => ({
250
246
  mentioned: ({ context }) => {
251
247
  kms.stm.api.mentioned({ context })
@@ -254,18 +250,16 @@ let createConfig = async () => {
254
250
  return kms.stm.api.mentions({ context })
255
251
  },
256
252
  }))
257
- })
258
- await config.setApi(api)
259
- await config.add(evaluate, articles)
260
-
261
- await config.restart_auto_rebuild()
262
- return config
263
- }
253
+ }
264
254
 
265
255
  knowledgeModule( {
256
+ config,
257
+ api: () => new API(),
258
+ includes: [evaluate, articles],
259
+ initializer,
260
+
266
261
  module,
267
262
  description: 'short term memory',
268
- createConfig,
269
263
  test: {
270
264
  name: './stm.test.json',
271
265
  contents: stm_tests,
package/common/tell.js CHANGED
@@ -1,4 +1,4 @@
1
- const { Config, knowledgeModule, where } = require('./runtime').theprogrammablemind
1
+ const { knowledgeModule, where } = require('./runtime').theprogrammablemind
2
2
  const { defaultContextCheck } = require('./helpers')
3
3
  const dialogues = require('./dialogues')
4
4
  const tell_tests = require('./tell.test.json')
@@ -40,7 +40,7 @@ class API {
40
40
 
41
41
  const api = new API()
42
42
 
43
- let configStruct = {
43
+ let config = {
44
44
  name: 'tell',
45
45
  operators: [
46
46
  "([tell] ([person]) ([info|]) ([event]))"
@@ -98,12 +98,7 @@ let configStruct = {
98
98
  ],
99
99
  };
100
100
 
101
- const createConfig = async () => {
102
- const config = new Config(configStruct, module)
103
- config.stop_auto_rebuild()
104
- await config.setApi(api)
105
- await config.add(dialogues)
106
- await config.initializer( ({config, isModule}) => {
101
+ const initializer = ({config, isModule}) => {
107
102
  if (!isModule) {
108
103
  config.addSemantic({
109
104
  match: ({context, hierarchy}) => context.happening && hierarchy.isA(context.marker, 'event'),
@@ -112,15 +107,16 @@ const createConfig = async () => {
112
107
  }
113
108
  })
114
109
  }
115
- })
116
- await config.restart_auto_rebuild()
117
- return config
118
- }
110
+ }
119
111
 
120
112
  knowledgeModule( {
113
+ config,
114
+ api: () => new API(),
115
+ includes: [dialogues],
116
+ initializer,
117
+
121
118
  module,
122
119
  description: 'telling entities things',
123
- createConfig,
124
120
  test: {
125
121
  name: './tell.test.json',
126
122
  contents: tell_tests,
@@ -3770,36 +3770,6 @@
3770
3770
  0
3771
3771
  ]
3772
3772
  ],
3773
- [
3774
- [
3775
- "celcius",
3776
- 0
3777
- ],
3778
- [
3779
- "divideByOperator",
3780
- 0
3781
- ],
3782
- [
3783
- "equals",
3784
- 0
3785
- ],
3786
- [
3787
- "fahrenheit",
3788
- 0
3789
- ],
3790
- [
3791
- "number",
3792
- 0
3793
- ],
3794
- [
3795
- "plusOperator",
3796
- 0
3797
- ],
3798
- [
3799
- "timesOperator",
3800
- 0
3801
- ]
3802
- ],
3803
3773
  [
3804
3774
  [
3805
3775
  "celcius",
@@ -5477,32 +5447,6 @@
5477
5447
  0
5478
5448
  ]
5479
5449
  ],
5480
- [
5481
- [
5482
- "celcius",
5483
- 0
5484
- ],
5485
- [
5486
- "divideByOperator",
5487
- 0
5488
- ],
5489
- [
5490
- "equals",
5491
- 0
5492
- ],
5493
- [
5494
- "number",
5495
- 0
5496
- ],
5497
- [
5498
- "plusOperator",
5499
- 0
5500
- ],
5501
- [
5502
- "timesOperator",
5503
- 0
5504
- ]
5505
- ],
5506
5450
  [
5507
5451
  [
5508
5452
  "celcius",
@@ -5700,36 +5644,6 @@
5700
5644
  0
5701
5645
  ]
5702
5646
  ],
5703
- [
5704
- [
5705
- "celcius",
5706
- 0
5707
- ],
5708
- [
5709
- "divideByOperator",
5710
- 0
5711
- ],
5712
- [
5713
- "equals",
5714
- 0
5715
- ],
5716
- [
5717
- "fahrenheit",
5718
- 0
5719
- ],
5720
- [
5721
- "number",
5722
- 0
5723
- ],
5724
- [
5725
- "plusOperator",
5726
- 0
5727
- ],
5728
- [
5729
- "timesOperator",
5730
- 0
5731
- ]
5732
- ],
5733
5647
  [
5734
5648
  [
5735
5649
  "celcius",
@@ -5884,32 +5798,6 @@
5884
5798
  0
5885
5799
  ]
5886
5800
  ],
5887
- [
5888
- [
5889
- "celcius",
5890
- 0
5891
- ],
5892
- [
5893
- "divideByOperator",
5894
- 0
5895
- ],
5896
- [
5897
- "equals",
5898
- 0
5899
- ],
5900
- [
5901
- "number",
5902
- 0
5903
- ],
5904
- [
5905
- "plusOperator",
5906
- 0
5907
- ],
5908
- [
5909
- "timesOperator",
5910
- 0
5911
- ]
5912
- ],
5913
5801
  [
5914
5802
  [
5915
5803
  "celcius",