theprogrammablemind 7.12.8-beta.0 → 7.12.8-beta.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/config.js +14 -2
package/package.json CHANGED
@@ -65,6 +65,6 @@
65
65
  "json-stable-stringify": "^1.0.1",
66
66
  "node-fetch": "^2.6.1"
67
67
  },
68
- "version": "7.12.8-beta.0",
68
+ "version": "7.12.8-beta.1",
69
69
  "license": "UNLICENSED"
70
70
  }
package/src/config.js CHANGED
@@ -213,6 +213,9 @@ const handleBridgeProps = (config, bridge, { addFirst, uuid } = {}) => {
213
213
  config.addHierarchy(child, bridge.id)
214
214
  }
215
215
  }
216
+ if (bridge.operator) {
217
+ config.addOperator(bridge.operator, uuid || config.uuid)
218
+ }
216
219
  if (bridge.parents) {
217
220
  for (const parent of bridge.parents) {
218
221
  config.addHierarchy(bridge.id, parent)
@@ -329,7 +332,7 @@ const handleBridgeProps = (config, bridge, { addFirst, uuid } = {}) => {
329
332
  if (bridge.semantic) {
330
333
  const semantic = {
331
334
  where: bridge.semantic.where || bridge.where || client.where(3),
332
- match: ({ context }) => bridge.id == context.marker,
335
+ match: ({ context }) => bridge.id == context.marker && !context.evaluate,
333
336
  apply: (args) => bridge.semantic(args),
334
337
  applyWrapped: bridge.semantic,
335
338
  property: 'semantic'
@@ -348,7 +351,7 @@ const handleCalculatedProps = (baseConfig, moreConfig, { addFirst, uuid } = {})
348
351
  if (moreConfig.bridges) {
349
352
  moreConfig.bridges = moreConfig.bridges.map((bridge) => {
350
353
  bridge = { ...bridge }
351
- const valid = ['after', 'before', 'bridge', 'development', 'evaluator', 'generatorp', 'generatorr', 'generatorpr', 'generators', 'id', 'convolution', 'inverted', 'isA', 'children', 'parents',
354
+ const valid = ['after', 'before', 'bridge', 'development', 'evaluator', 'generatorp', 'generatorr', 'generatorpr', 'generators', 'operator', 'id', 'convolution', 'inverted', 'isA', 'children', 'parents',
352
355
  'level', 'optional', 'selector', 'semantic', 'words', /Bridge$/, 'localHierarchy', 'levelSpecificHierarchy', 'where', 'uuid']
353
356
  helpers.validProps(valid, bridge, 'bridge')
354
357
  handleBridgeProps(baseConfig, bridge, { addFirst, uuid })
@@ -453,6 +456,7 @@ const normalizeConfig = (config) => {
453
456
  }
454
457
  }
455
458
  }
459
+
456
460
  if (config.bridges) {
457
461
  for (const bridge of config.bridges) {
458
462
  if (!bridge.level) {
@@ -471,6 +475,14 @@ const normalizeConfig = (config) => {
471
475
  }
472
476
  }
473
477
  }
478
+
479
+ if (config.operators) {
480
+ for (let i = 0; i < config.operators.length; ++i) {
481
+ if (typeof config.operators[i] === 'string') {
482
+ config.operators[i] = { pattern: config.operators[i] }
483
+ }
484
+ }
485
+ }
474
486
  }
475
487
  }
476
488