@knowlearning/agents 0.2.1 → 0.2.2

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.
@@ -8,7 +8,7 @@ const DEVELOPMENT_HOST = 'localhost:32001'
8
8
  export default () => {
9
9
  const { host, protocol } = window.location
10
10
 
11
- return GenericAgent({
11
+ const agent = GenericAgent({
12
12
  host: host.endsWith(DEVELOPMENT_HOST) ? DEVELOPMENT_HOST : 'api.knowlearning.systems',
13
13
  protocol: protocol === 'https:' ? 'wss' : 'ws',
14
14
  token: new Promise(r => onAuth(({ getIdToken: g }) => r(g()))),
@@ -20,4 +20,9 @@ export default () => {
20
20
  logout,
21
21
  reboot: () => window.location.reload()
22
22
  })
23
+
24
+ const { state } = agent
25
+ agent.state = (scope=host,user,domain) => state(scope, user, domain)
26
+
27
+ return agent
23
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowlearning/agents",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
5
  "main": "package/node.js",
6
6
  "browser": "package/browser.js",