@knowlearning/agents 0.9.108 → 0.9.110
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.
- package/agents/generic/index.js +1 -14
- package/package.json +1 -1
package/agents/generic/index.js
CHANGED
|
@@ -120,20 +120,7 @@ export default function Agent({ Connection, domain, token, uuid, fetch, applyPat
|
|
|
120
120
|
// if we are watching this scope, we want to keep track of last interaction we fired
|
|
121
121
|
const qualifiedScope = isUUID(scope) ? scope : `//${scope}`
|
|
122
122
|
if (manageLocalState && states[qualifiedScope] !== undefined) {
|
|
123
|
-
lastInteractionResponse[qualifiedScope] =
|
|
124
|
-
const resolveAndUnwatch = async update => {
|
|
125
|
-
log('AWAITING INTERACTION RESPONSE', qualifiedScope, update)
|
|
126
|
-
const { ii } = await response
|
|
127
|
-
log('GOT INTERACTION RESPONSE', qualifiedScope, await response)
|
|
128
|
-
if (update.ii === ii) {
|
|
129
|
-
resolve(ii)
|
|
130
|
-
removeWatcher(qualifiedScope, resolveAndUnwatch)
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
watchers[qualifiedScope].push(resolveAndUnwatch)
|
|
134
|
-
log('SETTING LAST INTERACTION RESPONSE PROMISE', qualifiedScope)
|
|
135
|
-
response.then(r => log('GOT INTERACTION RESPONSE FOR', qualifiedScope, r))
|
|
136
|
-
})
|
|
123
|
+
lastInteractionResponse[qualifiedScope] = response.then(r => r.ii)
|
|
137
124
|
return response
|
|
138
125
|
}
|
|
139
126
|
else {
|