@knowlearning/agents 0.9.157 → 0.9.158

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.
@@ -62,11 +62,11 @@ export default function EmbeddedAgent() {
62
62
  if (sentUpdates[key] === undefined || sentUpdates[key] + 1 === data.ii) {
63
63
  sendUpdate()
64
64
  } else if (data.ii === sentUpdates[key]) {
65
- console.warn('Repeated update for', key, data, sentUpdates[key])
65
+ //console.warn('Repeated update for', key, data, sentUpdates[key])
66
66
  } else if (data.ii < sentUpdates[key]) {
67
- console.warn('Out of order update, from past', key, JSON.stringify(data, null, 4), sentUpdates[key])
67
+ //console.warn('Out of order update, from past', key, JSON.stringify(data, null, 4), sentUpdates[key])
68
68
  } else {
69
- console.warn('Out of order update, fast forward', key, JSON.stringify(data, null, 4), sentUpdates[key])
69
+ //console.warn('Out of order update, fast forward', key, JSON.stringify(data, null, 4), sentUpdates[key])
70
70
  sendUpdate()
71
71
  }
72
72
  }
@@ -8,6 +8,7 @@ const SECURE = window.location.protocol === 'https:'
8
8
  const DEVELOPMENT_HOST = `localhost:3200${ SECURE ? '1' : '2' }`
9
9
  const ENVIRONMENT_API_HOST = localStorage.getItem('API_HOST')
10
10
  const REMOTE_HOST = window.location.hostname === TEST_DOMAIN && ENVIRONMENT_API_HOST ? ENVIRONMENT_API_HOST : 'api.knowlearning.systems'
11
+ const LANGUAGES = navigator.languages
11
12
 
12
13
  function isLocal() { return localStorage.getItem('api') === 'local' }
13
14
 
@@ -68,6 +69,7 @@ export default options => {
68
69
  applyPatch,
69
70
  login,
70
71
  logout,
72
+ variables: { LANGUAGES },
71
73
  reboot: () => window.location.reload()
72
74
  })
73
75
 
@@ -8,7 +8,7 @@ function activePatch(patch) {
8
8
  return structuredClone(patch).filter(({ path }) => 'active' === path.shift())
9
9
  }
10
10
 
11
- export default function messageQueue({ token, sid, domain, Connection, watchers, states, applyPatch, log, login, reboot, handleDomainMessage, trigger }) {
11
+ export default function messageQueue({ token, sid, domain, Connection, watchers, states, applyPatch, log, login, reboot, handleDomainMessage, trigger, variables={} }) {
12
12
  let connection
13
13
  let user
14
14
  let authed = false
@@ -36,7 +36,7 @@ export default function messageQueue({ token, sid, domain, Connection, watchers,
36
36
  authenticated: null
37
37
  }
38
38
 
39
- async function environment() { return { variables: {}, ...(await environmentPromise), context: [] } }
39
+ async function environment() { return { variables, ...(await environmentPromise), context: [] } }
40
40
 
41
41
  function queueMessage({ scope, patch }) {
42
42
  if (lastSynchronousScopePatched === scope) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowlearning/agents",
3
- "version": "0.9.157",
3
+ "version": "0.9.158",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
5
  "main": "node.js",
6
6
  "browser": "browser.js",