@knowlearning/agents 0.9.151 → 0.9.153

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.
@@ -183,7 +183,7 @@ export default function messageQueue({ token, sid, domain, Connection, watchers,
183
183
  states[qualifiedScope] = await states[qualifiedScope]
184
184
 
185
185
  if (states[qualifiedScope].ii + 1 !== message.ii) {
186
- console.warn('OUT OF ORDER WATCHER RECEIVED', qualifiedScope, states[qualifiedScope], message)
186
+ //console.warn('OUT OF ORDER WATCHER RECEIVED', qualifiedScope, states[qualifiedScope], message)
187
187
  return
188
188
  }
189
189
 
package/agents/watch.js CHANGED
@@ -79,7 +79,7 @@ export default function({ metadata, environment, state, watchers, synced, sentUp
79
79
  }
80
80
  const watcherIndex = watchers[key].findIndex(x => x === fn)
81
81
  if (watcherIndex > -1) watchers[key].splice(watcherIndex, 1)
82
- else console.warn('TRIED TO REMOVE WATCHER THAT DOES NOT EXIST', key, fn)
82
+ //else console.warn('TRIED TO REMOVE WATCHER THAT DOES NOT EXIST', key, fn)
83
83
  }
84
84
 
85
85
  return [ watch, removeWatcher ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowlearning/agents",
3
- "version": "0.9.151",
3
+ "version": "0.9.153",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
5
  "main": "node.js",
6
6
  "browser": "browser.js",
@@ -13,6 +13,8 @@
13
13
  </template>
14
14
 
15
15
  <script>
16
+ import browserAgent from '../../../agents/browser/initialize.js'
17
+
16
18
  export default {
17
19
  props: {
18
20
  id: {
@@ -55,7 +57,7 @@ export default {
55
57
  startWatching() {
56
58
  if (this.stopWatching) this.stopWatching()
57
59
  if (this.path.length) {
58
- this.stopWatching = Agent.watch([this.id, ...this.path], value => {
60
+ this.stopWatching = browserAgent().watch([this.id, ...this.path], value => {
59
61
  // TODO: ensure resolved value is uuid or URL
60
62
  this.resolvedId = value
61
63
  })
@@ -66,8 +68,8 @@ export default {
66
68
  if (!iframe || this.iframe === iframe) return
67
69
 
68
70
  this.iframe = iframe
69
- this.embedding = Agent.embed({ id, mode, namespace }, iframe)
70
- this.embedding.on('environment', e => this.environmentProxy ? this.environmentProxy(e) : Agent.environment(e))
71
+ this.embedding = browserAgent().embed({ id, mode, namespace }, iframe)
72
+ this.embedding.on('environment', e => this.environmentProxy ? this.environmentProxy(e) : browserAgent().environment(e))
71
73
  this.embedding.on('state', e => this.$emit('state', e))
72
74
  this.embedding.on('mutate', e => this.$emit('mutate', e))
73
75
  this.embedding.on('close', e => this.$emit('close', e))
@@ -8,6 +8,8 @@
8
8
  </template>
9
9
 
10
10
  <script>
11
+ import browserAgent from '../../../agents/browser/initialize.js'
12
+
11
13
  export default {
12
14
  props: {
13
15
  id: String
@@ -19,7 +21,7 @@
19
21
  }
20
22
  },
21
23
  async created() {
22
- this.metadata = await Agent.metadata(this.id)
24
+ this.metadata = await browserAgent().metadata(this.id)
23
25
  this.loading = false
24
26
  },
25
27
  computed: {
@@ -6,6 +6,7 @@
6
6
 
7
7
  <script setup>
8
8
  import { ref, watch, onMounted, onBeforeUnmount, computed } from 'vue'
9
+ import browserAgent from '../../../agents/browser/initialize.js'
9
10
 
10
11
  const props = defineProps({
11
12
  id: String,
@@ -26,10 +27,10 @@
26
27
  value.value = undefined
27
28
  }
28
29
  else if (props.metadata) {
29
- const metadata = await Agent.metadata(props.id)
30
+ const metadata = await browserAgent().metadata(props.id)
30
31
  value.value = props.path.length === 1 ? metadata[props.path[0]] : metadata
31
32
  } else {
32
- stopWatching = Agent.watch([props.id, ...props.path], v => value.value = v)
33
+ stopWatching = browserAgent().watch([props.id, ...props.path], v => value.value = v)
33
34
  }
34
35
  loading.value = false
35
36
  }