fix(sdk): use new interrupt schema for SDK (#1427)

This commit is contained in:
David Duong
2025-07-21 17:00:18 +02:00
committed by GitHub
parent 8c58ad1fbc
commit a0efb98059
5 changed files with 36 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"@langchain/langgraph-sdk": patch
---
Rename `interrupt_id` to `id`
+5
View File
@@ -0,0 +1,5 @@
---
"@langchain/langgraph": patch
---
Relax `when` type for `Interrupt`
+1 -1
View File
@@ -185,4 +185,4 @@
"zod/schema.d.ts",
"zod/schema.d.cts"
]
}
}
+1 -1
View File
@@ -194,7 +194,7 @@ export function _isSend(x: unknown): x is Send {
export type Interrupt<Value = any> = {
value?: Value;
// eslint-disable-next-line @typescript-eslint/ban-types
when: "during" | (string & {});
when?: "during" | (string & {});
resumable?: boolean;
ns?: string[];
interrupt_id?: string;
+24 -2
View File
@@ -145,10 +145,32 @@ export interface AssistantGraph {
* An interrupt thrown inside a thread.
*/
export interface Interrupt<TValue = unknown> {
interrupt_id?: string;
/**
* The ID of the interrupt.
*/
id?: string;
/**
* The value of the interrupt.
*/
value?: TValue;
when: "during" | (string & {}); // eslint-disable-line @typescript-eslint/ban-types
/**
* Will be deprecated in the future.
* @deprecated Will be removed in the future.
*/
when?: "during" | (string & {}); // eslint-disable-line @typescript-eslint/ban-types
/**
* Whether the interrupt can be resumed.
* @deprecated Will be removed in the future.
*/
resumable?: boolean;
/**
* The namespace of the interrupt.
* @deprecated Replaced by `interrupt_id`
*/
ns?: string[];
}