@langchain/langgraph-sdk 0.1.4 → 0.1.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @langchain/langgraph-sdk
2
2
 
3
+ ## 0.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - f21fd04: Fix mutate function in `onCustomEvent` and in `onUpdateEvent` receiving incorrect previous value
8
+
3
9
  ## 0.1.4
4
10
 
5
11
  ### Patch Changes
@@ -83,7 +83,10 @@ class StreamManager {
83
83
  writable: true,
84
84
  value: (kind, historyValues) => {
85
85
  return (update) => {
86
- const prev = { ...historyValues, ...this.state.values };
86
+ const prev = {
87
+ ...historyValues,
88
+ ...(this.state.values ?? [null, "stream"])[0],
89
+ };
87
90
  const next = typeof update === "function" ? update(prev) : update;
88
91
  this.setStreamValues({ ...prev, ...next }, kind);
89
92
  };
@@ -80,7 +80,10 @@ export class StreamManager {
80
80
  writable: true,
81
81
  value: (kind, historyValues) => {
82
82
  return (update) => {
83
- const prev = { ...historyValues, ...this.state.values };
83
+ const prev = {
84
+ ...historyValues,
85
+ ...(this.state.values ?? [null, "stream"])[0],
86
+ };
84
87
  const next = typeof update === "function" ? update(prev) : update;
85
88
  this.setStreamValues({ ...prev, ...next }, kind);
86
89
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langchain/langgraph-sdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Client library for interacting with the LangGraph API",
5
5
  "type": "module",
6
6
  "scripts": {