@knowlearning/agents 0.9.111 → 0.9.112

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.
@@ -10,6 +10,10 @@ function standardJSONPatch(patch) {
10
10
  })
11
11
  }
12
12
 
13
+ function activePatch(patch) {
14
+ return structuredClone(patch).filter(({ path }) => 'active' === path.shift())
15
+ }
16
+
13
17
  function sanitizeJSONPatchPathSegment(s) {
14
18
  if (typeof s === "string") return s.replaceAll('~', '~0').replaceAll('/', '~1')
15
19
  else return s
@@ -204,7 +208,7 @@ export default function messageQueue({ token, domain, Connection, watchers, stat
204
208
  watchers[qualifiedScope]
205
209
  .forEach(fn => {
206
210
  const state = structuredClone(states[qualifiedScope].active)
207
- fn({ ...message, state })
211
+ fn({ ...message, patch: activePatch(message.patch), state })
208
212
  })
209
213
  }
210
214
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowlearning/agents",
3
- "version": "0.9.111",
3
+ "version": "0.9.112",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
5
  "main": "node.js",
6
6
  "browser": "browser.js",