@knowlearning/agents 0.9.53 → 0.9.55

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.
@@ -122,6 +122,7 @@ export default function Agent({ host, token, WebSocket, protocol='ws', uuid, fet
122
122
 
123
123
  const resolveAndUnwatch = async (update) => {
124
124
  const { ii } = await response
125
+ console.log('RESOLVE LAST INTERACTION....', ii, update, scope)
125
126
  if (update.ii === ii) {
126
127
  resolve(ii)
127
128
  removeWatcher(qualifiedScope, resolveAndUnwatch)
@@ -14,20 +14,14 @@ export default function(scope='[]', user, domain, { keyToSubscriptionId, watcher
14
14
  watchers[qualifiedScope] = []
15
15
  states[qualifiedScope] = new Promise(async (resolve, reject) => {
16
16
  const { session } = await environment()
17
- await new Promise(r => setTimeout(r, 1))
17
+ await new Promise(r => setTimeout(r))
18
18
  interact('sessions', [{
19
19
  op: 'add',
20
20
  path: ['active', session, 'subscriptions', id],
21
- value: { session, scope, user, domain, ii: null }
21
+ value: { scope, user, domain, ii: null }
22
22
  }], false, false)
23
23
  try {
24
- const state = await lastMessageResponse()
25
- interact('sessions', [{
26
- op: 'add',
27
- path: ['active', session, 'subscriptions', id, 'ii'],
28
- value: state.ii
29
- }], false, false)
30
- resolve(state)
24
+ resolve(await lastMessageResponse())
31
25
  }
32
26
  catch (error) { reject(error) }
33
27
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowlearning/agents",
3
- "version": "0.9.53",
3
+ "version": "0.9.55",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
5
  "main": "node.js",
6
6
  "browser": "browser.js",