@knowlearning/agents 0.9.35 → 0.9.36

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.
@@ -59,8 +59,8 @@ function embed(environment, iframe) {
59
59
  }
60
60
  else if (type === 'environment') {
61
61
  const { context } = message
62
- const env = await Agent.environment()
63
- sendDown({ ...env, context: [...env.context, environment.id], mode: environment.mode })
62
+ const env = await (listeners.environment ? listeners.environment() : Agent.environment())
63
+ sendDown({ ...env, context: [...(env.context || []), environment.id], mode: environment.mode })
64
64
  }
65
65
  else if (type === 'interact') {
66
66
  const { scope, patch } = message
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowlearning/agents",
3
- "version": "0.9.35",
3
+ "version": "0.9.36",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
5
  "main": "node.js",
6
6
  "browser": "browser.js",
@@ -61,6 +61,7 @@ export default {
61
61
  this.embedding = Agent.embed({ id, mode }, iframe)
62
62
  this.embedding.on('state', e => this.$emit('state', e))
63
63
  this.embedding.on('mutate', e => this.$emit('mutate', e))
64
+ this.embedding.on('environment', e => this.$emit('environment', e))
64
65
  this.embedding.on('close', e => this.$emit('close', e))
65
66
  }
66
67
  }