@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.
- package/.env +0 -0
- package/.turbo/turbo-build.log +5 -0
- package/LICENSE +201 -201
- package/README.md +163 -163
- package/dist/LangGraphClient.js +4 -1
- package/dist/ToolManager.d.ts +3 -3
- package/dist/ToolManager.js +3 -2
- package/dist/server/createState.d.ts +13 -0
- package/dist/server/createState.js +20 -0
- package/dist/server/feTools.d.ts +16 -0
- package/dist/server/feTools.js +37 -0
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.js +3 -0
- package/dist/server/interrupt/index.d.ts +23 -0
- package/dist/server/interrupt/index.js +36 -0
- package/dist/server/swarm/handoff.d.ts +11 -0
- package/dist/server/swarm/handoff.js +84 -0
- package/dist/server/swarm/keepState.d.ts +6 -0
- package/dist/server/swarm/keepState.js +21 -0
- package/dist/server/tools/index.d.ts +1 -0
- package/dist/server/tools/index.js +1 -0
- package/dist/server/tools/sequential-thinking.d.ts +52 -0
- package/dist/server/tools/sequential-thinking.js +69 -0
- package/dist/server/utils.d.ts +3 -0
- package/dist/server/utils.js +24 -0
- package/dist/tool/createTool.d.ts +25 -23
- package/dist/tool/createTool.js +33 -9
- package/dist/ui-store/createChatStore.d.ts +3 -0
- package/dist/ui-store/createChatStore.js +13 -0
- package/package.json +1 -1
- package/src/LangGraphClient.ts +658 -655
- package/src/SpendTime.ts +60 -60
- package/src/ToolManager.ts +131 -132
- package/src/index.ts +5 -5
- package/src/tool/ToolUI.ts +55 -55
- package/src/tool/copilotkit-actions.ts +72 -72
- package/src/tool/createTool.ts +126 -107
- package/src/tool/index.ts +3 -3
- package/src/tool/utils.ts +158 -158
- package/src/ui-store/UnionStore.ts +29 -29
- package/src/ui-store/createChatStore.ts +309 -295
- package/src/ui-store/index.ts +2 -2
- package/src/ui-store/rafDebounce.ts +29 -29
- package/test/testResponse.json +5418 -5418
- 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
|
+
}
|