@langgraph-js/sdk 1.3.0 → 1.3.2

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.
@@ -478,7 +478,7 @@ export class LangGraphClient extends Client {
478
478
  this.graphMessages = [];
479
479
  this.streamingMessage = [];
480
480
  this.currentRun = undefined;
481
- this.tools.reset();
481
+ this.tools.clearWaiting();
482
482
  this.emitStreamingUpdate({
483
483
  type: "value",
484
484
  data: {
@@ -39,6 +39,7 @@ export declare class ToolManager {
39
39
  */
40
40
  clearTools(): void;
41
41
  reset(): void;
42
+ clearWaiting(): void;
42
43
  /**
43
44
  * @zh 调用指定名称的工具。
44
45
  * @en Calls the tool with the specified name.
@@ -56,6 +56,9 @@ export class ToolManager {
56
56
  }
57
57
  reset() {
58
58
  this.clearTools();
59
+ this.clearWaiting();
60
+ }
61
+ clearWaiting() {
59
62
  this.waitingMap.clear();
60
63
  }
61
64
  /**
@@ -105,6 +105,8 @@ export const createChatStore = (initClientName, config, context = {}) => {
105
105
  // console.log(event.data);
106
106
  // 创建新流程时,默认为 __start__
107
107
  currentNodeName.set("__start__");
108
+ if (event.type === "done")
109
+ loading.set(false);
108
110
  // 创建新会话时,需要自动刷新历史面板
109
111
  return refreshHistoryList();
110
112
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langgraph-js/sdk",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "The UI SDK for LangGraph - seamlessly integrate your AI agents with frontend interfaces",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -563,7 +563,7 @@ export class LangGraphClient extends Client {
563
563
  this.graphMessages = [];
564
564
  this.streamingMessage = [];
565
565
  this.currentRun = undefined;
566
- this.tools.reset();
566
+ this.tools.clearWaiting();
567
567
  this.emitStreamingUpdate({
568
568
  type: "value",
569
569
  data: {
@@ -63,6 +63,9 @@ export class ToolManager {
63
63
  }
64
64
  reset() {
65
65
  this.clearTools();
66
+ this.clearWaiting();
67
+ }
68
+ clearWaiting() {
66
69
  this.waitingMap.clear();
67
70
  }
68
71
 
@@ -111,6 +111,7 @@ export const createChatStore = (
111
111
  // console.log(event.data);
112
112
  // 创建新流程时,默认为 __start__
113
113
  currentNodeName.set("__start__");
114
+ if (event.type === "done") loading.set(false);
114
115
  // 创建新会话时,需要自动刷新历史面板
115
116
  return refreshHistoryList();
116
117
  }