@knowlearning/agents 0.7.3 → 0.7.4

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.js CHANGED
@@ -181,7 +181,11 @@ export default function Agent({ host, token, WebSocket, protocol='ws', uuid, fet
181
181
 
182
182
  if (states[message.scope].active === undefined) states[message.scope].active = {}
183
183
  applyPatch(states[message.scope], standardJSONPatch(message.patch.slice(lastResetPatchIndex + 1)))
184
- watchers[message.scope].forEach(fn => fn({ ...message, state: states[message.scope].active }))
184
+ watchers[message.scope]
185
+ .forEach(fn => {
186
+ const state = structuredClone(states[message.scope].active)
187
+ fn({ ...message, state })
188
+ })
185
189
  if (sub) sub.ii = message.ii
186
190
  }
187
191
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowlearning/agents",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
5
  "main": "node.js",
6
6
  "browser": "browser.js",