@knowlearning/agents 0.9.38 → 0.9.40

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.
@@ -12,8 +12,7 @@ if (window.location.pathname.startsWith('/auth/')) {
12
12
  }
13
13
  }
14
14
 
15
- function login() {
16
- const provider = 'google'
15
+ function login(provider='google') {
17
16
  const state = Math.random().toString(36).substring(2)
18
17
  window.localStorage.setItem(state, window.location.href)
19
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowlearning/agents",
3
- "version": "0.9.38",
3
+ "version": "0.9.40",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
5
  "main": "node.js",
6
6
  "browser": "browser.js",
@@ -9,7 +9,8 @@
9
9
  props: {
10
10
  id: String,
11
11
  path: { type: Array, default: [] },
12
- placeholder: { type: String, default: '' }
12
+ placeholder: { type: String, default: '' },
13
+ metadata: { type: Boolean, default: false }
13
14
  },
14
15
  data() {
15
16
  return {
@@ -28,9 +29,13 @@
28
29
  if (this.stopWatching) this.stopWatching()
29
30
  },
30
31
  methods: {
31
- startWatching() {
32
+ async startWatching() {
32
33
  if (this.stopWatching) this.stopWatching()
33
- this.stopWatching = Agent.watch([this.id, ...this.path], value => this.value = value)
34
+ if (this.metadata) {
35
+ const metadata = await Agent.metadata(this.id)
36
+ this.value = this.path.length === 1 ? metadata[this.path[0]] : metadata
37
+ }
38
+ else this.stopWatching = Agent.watch([this.id, ...this.path], value => this.value = value)
34
39
  }
35
40
  }
36
41
  }