@langgraph-js/sdk 1.5.1 → 1.5.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.
@@ -444,7 +444,7 @@ export class LangGraphClient extends Client {
444
444
  }
445
445
  runFETool() {
446
446
  var _a;
447
- const data = this.graphMessages;
447
+ const data = this.streamingMessage; // 需要保证不被清理
448
448
  const lastMessage = data[data.length - 1];
449
449
  // 如果最后一条消息是前端工具消息,则调用工具
450
450
  if (lastMessage.type === "ai" && ((_a = lastMessage.tool_calls) === null || _a === void 0 ? void 0 : _a.length)) {
@@ -461,6 +461,7 @@ export class LangGraphClient extends Client {
461
461
  return this.callFETool(toolMessage, tool.args);
462
462
  }
463
463
  });
464
+ this.currentThread.status = "interrupted"; // 修复某些机制下,状态不为 interrupted 与后端有差异
464
465
  return Promise.all(result);
465
466
  }
466
467
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@langgraph-js/sdk",
3
- "version": "1.5.1",
3
+ "version": "1.5.4",
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",
@@ -526,8 +526,9 @@ export class LangGraphClient extends Client {
526
526
  }
527
527
  });
528
528
  }
529
+
529
530
  private runFETool() {
530
- const data = this.graphMessages;
531
+ const data = this.streamingMessage; // 需要保证不被清理
531
532
  const lastMessage = data[data.length - 1];
532
533
  // 如果最后一条消息是前端工具消息,则调用工具
533
534
  if (lastMessage.type === "ai" && lastMessage.tool_calls?.length) {
@@ -544,6 +545,7 @@ export class LangGraphClient extends Client {
544
545
  return this.callFETool(toolMessage, tool.args);
545
546
  }
546
547
  });
548
+ this.currentThread!.status = "interrupted"; // 修复某些机制下,状态不为 interrupted 与后端有差异
547
549
  return Promise.all(result);
548
550
  }
549
551
  }