@langgraph-js/sdk 1.7.11 → 1.9.0

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.
Files changed (45) hide show
  1. package/.env +0 -0
  2. package/.turbo/turbo-build.log +5 -0
  3. package/LICENSE +201 -201
  4. package/README.md +163 -163
  5. package/dist/LangGraphClient.js +4 -1
  6. package/dist/ToolManager.d.ts +3 -3
  7. package/dist/ToolManager.js +3 -2
  8. package/dist/server/createState.d.ts +13 -0
  9. package/dist/server/createState.js +20 -0
  10. package/dist/server/feTools.d.ts +16 -0
  11. package/dist/server/feTools.js +37 -0
  12. package/dist/server/index.d.ts +3 -0
  13. package/dist/server/index.js +3 -0
  14. package/dist/server/interrupt/index.d.ts +23 -0
  15. package/dist/server/interrupt/index.js +36 -0
  16. package/dist/server/swarm/handoff.d.ts +11 -0
  17. package/dist/server/swarm/handoff.js +84 -0
  18. package/dist/server/swarm/keepState.d.ts +6 -0
  19. package/dist/server/swarm/keepState.js +21 -0
  20. package/dist/server/tools/index.d.ts +1 -0
  21. package/dist/server/tools/index.js +1 -0
  22. package/dist/server/tools/sequential-thinking.d.ts +52 -0
  23. package/dist/server/tools/sequential-thinking.js +69 -0
  24. package/dist/server/utils.d.ts +3 -0
  25. package/dist/server/utils.js +24 -0
  26. package/dist/tool/createTool.d.ts +25 -23
  27. package/dist/tool/createTool.js +33 -9
  28. package/dist/ui-store/createChatStore.d.ts +3 -0
  29. package/dist/ui-store/createChatStore.js +13 -0
  30. package/package.json +1 -1
  31. package/src/LangGraphClient.ts +658 -655
  32. package/src/SpendTime.ts +60 -60
  33. package/src/ToolManager.ts +131 -132
  34. package/src/index.ts +5 -5
  35. package/src/tool/ToolUI.ts +55 -55
  36. package/src/tool/copilotkit-actions.ts +72 -72
  37. package/src/tool/createTool.ts +126 -107
  38. package/src/tool/index.ts +3 -3
  39. package/src/tool/utils.ts +158 -158
  40. package/src/ui-store/UnionStore.ts +29 -29
  41. package/src/ui-store/createChatStore.ts +309 -295
  42. package/src/ui-store/index.ts +2 -2
  43. package/src/ui-store/rafDebounce.ts +29 -29
  44. package/test/testResponse.json +5418 -5418
  45. package/tsconfig.json +112 -112
@@ -1,29 +1,29 @@
1
- /**
2
- * Creates a debounced function that executes once per animation frame
3
- * @param callback - The function to debounce
4
- * @returns A function that executes the callback on the next animation frame
5
- */
6
- export function rafDebounce<T extends (...args: any[]) => any>(callback: T): (...args: Parameters<T>) => void {
7
- let rafId: number | null = null;
8
- let lastArgs: Parameters<T> | null = null;
9
-
10
- // Return the debounced function
11
- return function (...args: Parameters<T>): void {
12
- // Store the most recent arguments
13
- lastArgs = args;
14
-
15
- // Cancel any pending animation frame
16
- if (rafId !== null) {
17
- cancelAnimationFrame(rafId);
18
- }
19
-
20
- // Schedule execution on the next animation frame
21
- rafId = requestAnimationFrame(() => {
22
- if (lastArgs !== null) {
23
- callback(...lastArgs);
24
- lastArgs = null;
25
- }
26
- rafId = null;
27
- });
28
- };
29
- }
1
+ /**
2
+ * Creates a debounced function that executes once per animation frame
3
+ * @param callback - The function to debounce
4
+ * @returns A function that executes the callback on the next animation frame
5
+ */
6
+ export function rafDebounce<T extends (...args: any[]) => any>(callback: T): (...args: Parameters<T>) => void {
7
+ let rafId: number | null = null;
8
+ let lastArgs: Parameters<T> | null = null;
9
+
10
+ // Return the debounced function
11
+ return function (...args: Parameters<T>): void {
12
+ // Store the most recent arguments
13
+ lastArgs = args;
14
+
15
+ // Cancel any pending animation frame
16
+ if (rafId !== null) {
17
+ cancelAnimationFrame(rafId);
18
+ }
19
+
20
+ // Schedule execution on the next animation frame
21
+ rafId = requestAnimationFrame(() => {
22
+ if (lastArgs !== null) {
23
+ callback(...lastArgs);
24
+ lastArgs = null;
25
+ }
26
+ rafId = null;
27
+ });
28
+ };
29
+ }