diff --git a/libs/sdk-js/src/schema.ts b/libs/sdk-js/src/schema.ts index 1b9dae1fe..8884708e4 100644 --- a/libs/sdk-js/src/schema.ts +++ b/libs/sdk-js/src/schema.ts @@ -137,6 +137,16 @@ export interface AssistantGraph { }>; } +/** + * An interrupt thrown inside a thread. + */ +export interface Interrupt { + value: unknown; + when: "during"; + resumable: boolean; + ns?: string[]; +} + export interface Thread { /** The ID of the thread. */ thread_id: string; @@ -155,6 +165,9 @@ export interface Thread { /** The current state of the thread. */ values: ValuesType; + + /** Interrupts which were thrown in this thread */ + interrupts: {} | { [id: string]: Array }; } export interface Cron { @@ -210,12 +223,7 @@ export interface ThreadTask { name: string; result?: unknown; error: Optional; - interrupts: Array<{ - value: unknown; - when: "during"; - resumable: boolean; - ns?: string[]; - }>; + interrupts: Array; checkpoint: Optional; state: Optional; }