@langgraph-js/sdk 3.5.0 → 3.5.1
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/dist/LangGraphClient.js +1 -0
- package/dist/test-type.d.ts +1 -0
- package/dist/test-type.js +5 -0
- package/dist/tool/createTool.d.ts +16 -2
- package/package.json +1 -1
- package/src/LangGraphClient.ts +1 -0
- package/src/tool/createTool.ts +14 -2
package/dist/LangGraphClient.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -22,10 +22,24 @@ export interface UnionTool<Args extends ZodRawShape, Child extends Object = Obje
|
|
|
22
22
|
isPureParams?: boolean;
|
|
23
23
|
}
|
|
24
24
|
export type ToolCallback<Args extends ZodRawShape> = (args: z.infer<z.ZodObject<Args>>, context?: any) => CallToolResult | Promise<CallToolResult>;
|
|
25
|
+
export type InterruptResponse = {
|
|
26
|
+
decisions: ({
|
|
27
|
+
type: "approve";
|
|
28
|
+
} | {
|
|
29
|
+
type: "edit";
|
|
30
|
+
edited_action: {
|
|
31
|
+
name: string;
|
|
32
|
+
args: Record<string, any>;
|
|
33
|
+
};
|
|
34
|
+
} | {
|
|
35
|
+
type: "reject";
|
|
36
|
+
message: string;
|
|
37
|
+
})[];
|
|
38
|
+
};
|
|
25
39
|
export type CallToolResult = string | {
|
|
26
40
|
type: "text";
|
|
27
41
|
text: string;
|
|
28
|
-
}[];
|
|
42
|
+
}[] | InterruptResponse;
|
|
29
43
|
/** 用于格式校验 */
|
|
30
44
|
export declare const createTool: <Args extends ZodRawShape>(tool: UnionTool<Args>) => UnionTool<Args, Object, any>;
|
|
31
45
|
/**
|
|
@@ -159,7 +173,7 @@ export declare const createMCPTool: <Args extends ZodRawShape>(tool: UnionTool<A
|
|
|
159
173
|
content: {
|
|
160
174
|
type: "text";
|
|
161
175
|
text: string;
|
|
162
|
-
}[] | undefined;
|
|
176
|
+
}[] | InterruptResponse | undefined;
|
|
163
177
|
isError?: undefined;
|
|
164
178
|
} | {
|
|
165
179
|
content: {
|
package/package.json
CHANGED
package/src/LangGraphClient.ts
CHANGED
package/src/tool/createTool.ts
CHANGED
|
@@ -25,8 +25,20 @@ export interface UnionTool<Args extends ZodRawShape, Child extends Object = Obje
|
|
|
25
25
|
isPureParams?: boolean;
|
|
26
26
|
}
|
|
27
27
|
export type ToolCallback<Args extends ZodRawShape> = (args: z.infer<z.ZodObject<Args>>, context?: any) => CallToolResult | Promise<CallToolResult>;
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
export type InterruptResponse = {
|
|
29
|
+
decisions: (
|
|
30
|
+
| { type: "approve" }
|
|
31
|
+
| {
|
|
32
|
+
type: "edit";
|
|
33
|
+
edited_action: {
|
|
34
|
+
name: string;
|
|
35
|
+
args: Record<string, any>;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
| { type: "reject"; message: string }
|
|
39
|
+
)[];
|
|
40
|
+
};
|
|
41
|
+
export type CallToolResult = string | { type: "text"; text: string }[] | InterruptResponse;
|
|
30
42
|
|
|
31
43
|
/** 用于格式校验 */
|
|
32
44
|
export const createTool = <Args extends ZodRawShape>(tool: UnionTool<Args>) => {
|