@langchain/langgraph-sdk 1.6.0 → 1.6.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.
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":["Client","ThreadState","Message","StreamMode","Sequence","GetUpdateType","GetConfigurableType","GetInterruptType","GetToolCallsType","MessageMetadata","UseStreamThread","UseStreamOptions","UseStreamTransport","UseStreamCustomOptions","SubmitOptions","CustomSubmitOptions","RunCallbackMeta","SubagentStream","StreamBase","DefaultSubagentStates","SubAgentLike","CompiledSubAgentLike","DeepAgentTypeConfigLike","IsDeepAgentLike","ExtractDeepAgentConfig","ExtractSubAgentMiddleware","InferDeepAgentSubagents","InferSubagentByName","InferSubagentState","InferSubagentNames","SubagentStateMap","BaseSubagentState","BagTemplate","StreamEvent","UseStream","Record","StateType","Bag","SubagentStates","Promise","UseStreamCustom","Pick"],"sources":["../../src/react/types.d.ts"],"sourcesContent":["import type { Client } from \"../client.js\";\nimport type { ThreadState } from \"../schema.js\";\nimport type { Message } from \"../types.messages.js\";\nimport type { StreamMode } from \"../types.stream.js\";\nimport type { Sequence } from \"../ui/branching.js\";\nimport type { GetUpdateType, GetConfigurableType, GetInterruptType, GetToolCallsType, MessageMetadata, UseStreamThread, UseStreamOptions, UseStreamTransport, UseStreamCustomOptions, SubmitOptions, CustomSubmitOptions, RunCallbackMeta, SubagentStream, StreamBase, DefaultSubagentStates, SubAgentLike, CompiledSubAgentLike, DeepAgentTypeConfigLike, IsDeepAgentLike, ExtractDeepAgentConfig, ExtractSubAgentMiddleware, InferDeepAgentSubagents, InferSubagentByName, InferSubagentState, InferSubagentNames, SubagentStateMap, BaseSubagentState } from \"../ui/types.js\";\nimport type { BagTemplate } from \"../types.template.js\";\nimport type { StreamEvent } from \"../types.js\";\nexport type { GetUpdateType, GetConfigurableType, GetInterruptType, GetToolCallsType, MessageMetadata, UseStreamThread, UseStreamOptions, UseStreamTransport, UseStreamCustomOptions, SubmitOptions, CustomSubmitOptions, RunCallbackMeta, SubagentStream, StreamBase, DefaultSubagentStates, SubAgentLike, CompiledSubAgentLike, DeepAgentTypeConfigLike, IsDeepAgentLike, ExtractDeepAgentConfig, ExtractSubAgentMiddleware, InferDeepAgentSubagents, InferSubagentByName, InferSubagentState, InferSubagentNames, SubagentStateMap, BaseSubagentState, };\nexport interface UseStream<StateType extends Record<string, unknown> = Record<string, unknown>, Bag extends BagTemplate = BagTemplate, SubagentStates extends Record<string, unknown> = DefaultSubagentStates> extends StreamBase<StateType, GetToolCallsType<StateType>, GetInterruptType<Bag>, SubagentStates> {\n /**\n * Whether the thread is currently being loaded.\n */\n isThreadLoading: boolean;\n /**\n * Stops the stream.\n */\n stop: () => Promise<void>;\n /**\n * Create and stream a run to the thread.\n */\n submit: (values: GetUpdateType<Bag, StateType> | null | undefined, options?: SubmitOptions<StateType, GetConfigurableType<Bag>>) => Promise<void>;\n /**\n * The current branch of the thread.\n */\n branch: string;\n /**\n * Set the branch of the thread.\n */\n setBranch: (branch: string) => void;\n /**\n * Flattened history of thread states of a thread.\n */\n history: ThreadState<StateType>[];\n /**\n * Tree of all branches for the thread.\n * @experimental\n */\n experimental_branchTree: Sequence<StateType>;\n /**\n * Get the metadata for a message, such as first thread state the message\n * was seen in and branch information.\n *\n * @param message - The message to get the metadata for.\n * @param index - The index of the message in the thread.\n * @returns The metadata for the message.\n */\n getMessagesMetadata: (message: Message<GetToolCallsType<StateType>>, index?: number) => MessageMetadata<StateType> | undefined;\n /**\n * LangGraph SDK client used to send request and receive responses.\n */\n client: Client;\n /**\n * The ID of the assistant to use.\n */\n assistantId: string;\n /**\n * Join an active stream.\n */\n joinStream: (runId: string, lastEventId?: string, options?: {\n streamMode?: StreamMode | StreamMode[];\n filter?: (event: {\n id?: string;\n event: StreamEvent;\n data: unknown;\n }) => boolean;\n }) => Promise<void>;\n}\nexport type UseStreamCustom<StateType extends Record<string, unknown> = Record<string, unknown>, Bag extends BagTemplate = BagTemplate, SubagentStates extends Record<string, unknown> = DefaultSubagentStates> = Pick<UseStream<StateType, Bag, SubagentStates>, \"values\" | \"error\" | \"isLoading\" | \"stop\" | \"interrupt\" | \"messages\" | \"toolCalls\" | \"getToolCalls\" | \"subagents\" | \"activeSubagents\" | \"getSubagent\" | \"getSubagentsByType\" | \"getSubagentsByMessage\"> & {\n submit: (values: GetUpdateType<Bag, StateType> | null | undefined, options?: CustomSubmitOptions<StateType, GetConfigurableType<Bag>>) => Promise<void>;\n};\n"],"mappings":";;;;;;;;;;UASiBkC,4BAA4BC,0BAA0BA,qCAAqCH,cAAcA,oCAAoCG,0BAA0BhB,+BAA+BD,WAAWkB,WAAW5B,iBAAiB4B,YAAY7B,iBAAiB8B,MAAMC;EAAhRJ;;;iBAAsDC,EAAAA,OAAAA;;;;MAAiHhB,EAAAA,GAAAA,GAQxKoB,OARwKpB,CAAAA,IAAAA,CAAAA;;;;QAAmGkB,EAAAA,CAAAA,MAAAA,EAYtQhC,aAZsQgC,CAYxPA,GAZwPA,EAYnPD,SAZmPC,CAAAA,GAAAA,IAAAA,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,EAY1MvB,aAZ0MuB,CAY5LD,SAZ4LC,EAYjL/B,mBAZiL+B,CAY7JA,GAZ6JA,CAAAA,CAAAA,EAAAA,GAYnJE,OAZmJF,CAAAA,IAAAA,CAAAA;;;;QAYxPA,EAAAA,MAAAA;;;;WAA2FA,EAAAA,CAAAA,MAAAA,EAAAA,MAAAA,EAAAA,GAAAA,IAAAA;;;;SAYrGD,EAAZnC,WAAYmC,CAAAA,SAAAA,CAAAA,EAAAA;;;;;yBAckB5B,EATdJ,QAScI,CATL4B,SASK5B,CAAAA;;;;;;;;;qBAtC4KU,EAAAA,CAAAA,OAAAA,EAsCpLhB,OAtCoLgB,CAsC5KV,gBAtC4KU,CAsC3JkB,SAtC2JlB,CAAAA,CAAAA,EAAAA,KAAAA,CAAAA,EAAAA,MAAAA,EAAAA,GAsC3HT,eAtC2HS,CA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,EAA7DxB,mBAA6DwB,CAAzCH,SAAyCG,EAA9BjC,mBAA8BiC,CAAVF,GAAUE,CAAAA,CAAAA,EAAAA,GAAAA,OAAAA,CAAAA,IAAAA,CAAAA;CAAO"}
1
+ {"version":3,"file":"types.d.cts","names":["Client","ThreadState","Message","StreamMode","Sequence","GetUpdateType","GetConfigurableType","GetInterruptType","GetToolCallsType","MessageMetadata","UseStreamThread","UseStreamOptions","UseStreamTransport","UseStreamCustomOptions","SubmitOptions","CustomSubmitOptions","RunCallbackMeta","SubagentStream","StreamBase","DefaultSubagentStates","SubAgentLike","CompiledSubAgentLike","DeepAgentTypeConfigLike","IsDeepAgentLike","ExtractDeepAgentConfig","ExtractSubAgentMiddleware","InferDeepAgentSubagents","InferSubagentByName","InferSubagentState","InferSubagentNames","SubagentStateMap","BaseSubagentState","BagTemplate","StreamEvent","UseStream","Record","StateType","Bag","SubagentStates","Promise","UseStreamCustom","Pick"],"sources":["../../src/react/types.d.ts"],"sourcesContent":["import type { Client } from \"../client.js\";\nimport type { ThreadState } from \"../schema.js\";\nimport type { Message } from \"../types.messages.js\";\nimport type { StreamMode } from \"../types.stream.js\";\nimport type { Sequence } from \"../ui/branching.js\";\nimport type { GetUpdateType, GetConfigurableType, GetInterruptType, GetToolCallsType, MessageMetadata, UseStreamThread, UseStreamOptions, UseStreamTransport, UseStreamCustomOptions, SubmitOptions, CustomSubmitOptions, RunCallbackMeta, SubagentStream, StreamBase, DefaultSubagentStates, SubAgentLike, CompiledSubAgentLike, DeepAgentTypeConfigLike, IsDeepAgentLike, ExtractDeepAgentConfig, ExtractSubAgentMiddleware, InferDeepAgentSubagents, InferSubagentByName, InferSubagentState, InferSubagentNames, SubagentStateMap, BaseSubagentState } from \"../ui/types.js\";\nimport type { BagTemplate } from \"../types.template.js\";\nimport type { StreamEvent } from \"../types.js\";\nexport type { GetUpdateType, GetConfigurableType, GetInterruptType, GetToolCallsType, MessageMetadata, UseStreamThread, UseStreamOptions, UseStreamTransport, UseStreamCustomOptions, SubmitOptions, CustomSubmitOptions, RunCallbackMeta, SubagentStream, StreamBase, DefaultSubagentStates, SubAgentLike, CompiledSubAgentLike, DeepAgentTypeConfigLike, IsDeepAgentLike, ExtractDeepAgentConfig, ExtractSubAgentMiddleware, InferDeepAgentSubagents, InferSubagentByName, InferSubagentState, InferSubagentNames, SubagentStateMap, BaseSubagentState, };\nexport interface UseStream<StateType extends Record<string, unknown> = Record<string, unknown>, Bag extends BagTemplate = BagTemplate, SubagentStates extends Record<string, unknown> = DefaultSubagentStates> extends StreamBase<StateType, GetToolCallsType<StateType>, GetInterruptType<Bag>, SubagentStates> {\n /**\n * Whether the thread is currently being loaded.\n */\n isThreadLoading: boolean;\n /**\n * Stops the stream.\n */\n stop: () => Promise<void>;\n /**\n * Create and stream a run to the thread.\n */\n submit: (values: GetUpdateType<Bag, StateType> | null | undefined, options?: SubmitOptions<StateType, GetConfigurableType<Bag>>) => Promise<void>;\n /**\n * The current branch of the thread.\n */\n branch: string;\n /**\n * Set the branch of the thread.\n */\n setBranch: (branch: string) => void;\n /**\n * Flattened history of thread states of a thread.\n */\n history: ThreadState<StateType>[];\n /**\n * Tree of all branches for the thread.\n * @experimental\n */\n experimental_branchTree: Sequence<StateType>;\n /**\n * Get the metadata for a message, such as first thread state the message\n * was seen in and branch information.\n *\n * @param message - The message to get the metadata for.\n * @param index - The index of the message in the thread.\n * @returns The metadata for the message.\n */\n getMessagesMetadata: (message: Message<GetToolCallsType<StateType>>, index?: number) => MessageMetadata<StateType> | undefined;\n /**\n * LangGraph SDK client used to send request and receive responses.\n */\n client: Client;\n /**\n * The ID of the assistant to use.\n */\n assistantId: string;\n /**\n * Join an active stream.\n */\n joinStream: (runId: string, lastEventId?: string, options?: {\n streamMode?: StreamMode | StreamMode[];\n filter?: (event: {\n id?: string;\n event: StreamEvent;\n data: unknown;\n }) => boolean;\n }) => Promise<void>;\n}\nexport type UseStreamCustom<StateType extends Record<string, unknown> = Record<string, unknown>, Bag extends BagTemplate = BagTemplate, SubagentStates extends Record<string, unknown> = DefaultSubagentStates> = Pick<UseStream<StateType, Bag, SubagentStates>, \"values\" | \"error\" | \"isLoading\" | \"stop\" | \"interrupt\" | \"interrupts\" | \"messages\" | \"toolCalls\" | \"getToolCalls\" | \"subagents\" | \"activeSubagents\" | \"getSubagent\" | \"getSubagentsByType\" | \"getSubagentsByMessage\"> & {\n submit: (values: GetUpdateType<Bag, StateType> | null | undefined, options?: CustomSubmitOptions<StateType, GetConfigurableType<Bag>>) => Promise<void>;\n};\n"],"mappings":";;;;;;;;;;UASiBkC,4BAA4BC,0BAA0BA,qCAAqCH,cAAcA,oCAAoCG,0BAA0BhB,+BAA+BD,WAAWkB,WAAW5B,iBAAiB4B,YAAY7B,iBAAiB8B,MAAMC;EAAhRJ;;;iBAAsDC,EAAAA,OAAAA;;;;MAAiHhB,EAAAA,GAAAA,GAQxKoB,OARwKpB,CAAAA,IAAAA,CAAAA;;;;QAAmGkB,EAAAA,CAAAA,MAAAA,EAYtQhC,aAZsQgC,CAYxPA,GAZwPA,EAYnPD,SAZmPC,CAAAA,GAAAA,IAAAA,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,EAY1MvB,aAZ0MuB,CAY5LD,SAZ4LC,EAYjL/B,mBAZiL+B,CAY7JA,GAZ6JA,CAAAA,CAAAA,EAAAA,GAYnJE,OAZmJF,CAAAA,IAAAA,CAAAA;;;;QAYxPA,EAAAA,MAAAA;;;;WAA2FA,EAAAA,CAAAA,MAAAA,EAAAA,MAAAA,EAAAA,GAAAA,IAAAA;;;;SAYrGD,EAAZnC,WAAYmC,CAAAA,SAAAA,CAAAA,EAAAA;;;;;yBAckB5B,EATdJ,QAScI,CATL4B,SASK5B,CAAAA;;;;;;;;;qBAtC4KU,EAAAA,CAAAA,OAAAA,EAsCpLhB,OAtCoLgB,CAsC5KV,gBAtC4KU,CAsC3JkB,SAtC2JlB,CAAAA,CAAAA,EAAAA,KAAAA,CAAAA,EAAAA,MAAAA,EAAAA,G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GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,EAA7DxB,mBAA6DwB,CAAzCH,SAAyCG,EAA9BjC,mBAA8BiC,CAAVF,GAAUE,CAAAA,CAAAA,EAAAA,GAAAA,OAAAA,CAAAA,IAAAA,CAAAA;CAAO"}
@@ -67,7 +67,7 @@ interface UseStream<StateType extends Record<string, unknown> = Record<string, u
67
67
  }) => boolean;
68
68
  }) => Promise<void>;
69
69
  }
70
- type UseStreamCustom<StateType extends Record<string, unknown> = Record<string, unknown>, Bag extends BagTemplate = BagTemplate, SubagentStates extends Record<string, unknown> = DefaultSubagentStates> = Pick<UseStream<StateType, Bag, SubagentStates>, "values" | "error" | "isLoading" | "stop" | "interrupt" | "messages" | "toolCalls" | "getToolCalls" | "subagents" | "activeSubagents" | "getSubagent" | "getSubagentsByType" | "getSubagentsByMessage"> & {
70
+ type UseStreamCustom<StateType extends Record<string, unknown> = Record<string, unknown>, Bag extends BagTemplate = BagTemplate, SubagentStates extends Record<string, unknown> = DefaultSubagentStates> = Pick<UseStream<StateType, Bag, SubagentStates>, "values" | "error" | "isLoading" | "stop" | "interrupt" | "interrupts" | "messages" | "toolCalls" | "getToolCalls" | "subagents" | "activeSubagents" | "getSubagent" | "getSubagentsByType" | "getSubagentsByMessage"> & {
71
71
  submit: (values: GetUpdateType<Bag, StateType> | null | undefined, options?: CustomSubmitOptions<StateType, GetConfigurableType<Bag>>) => Promise<void>;
72
72
  };
73
73
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","names":["Client","ThreadState","Message","StreamMode","Sequence","GetUpdateType","GetConfigurableType","GetInterruptType","GetToolCallsType","MessageMetadata","UseStreamThread","UseStreamOptions","UseStreamTransport","UseStreamCustomOptions","SubmitOptions","CustomSubmitOptions","RunCallbackMeta","SubagentStream","StreamBase","DefaultSubagentStates","SubAgentLike","CompiledSubAgentLike","DeepAgentTypeConfigLike","IsDeepAgentLike","ExtractDeepAgentConfig","ExtractSubAgentMiddleware","InferDeepAgentSubagents","InferSubagentByName","InferSubagentState","InferSubagentNames","SubagentStateMap","BaseSubagentState","BagTemplate","StreamEvent","UseStream","Record","StateType","Bag","SubagentStates","Promise","UseStreamCustom","Pick"],"sources":["../../src/react/types.d.ts"],"sourcesContent":["import type { Client } from \"../client.js\";\nimport type { ThreadState } from \"../schema.js\";\nimport type { Message } from \"../types.messages.js\";\nimport type { StreamMode } from \"../types.stream.js\";\nimport type { Sequence } from \"../ui/branching.js\";\nimport type { GetUpdateType, GetConfigurableType, GetInterruptType, GetToolCallsType, MessageMetadata, UseStreamThread, UseStreamOptions, UseStreamTransport, UseStreamCustomOptions, SubmitOptions, CustomSubmitOptions, RunCallbackMeta, SubagentStream, StreamBase, DefaultSubagentStates, SubAgentLike, CompiledSubAgentLike, DeepAgentTypeConfigLike, IsDeepAgentLike, ExtractDeepAgentConfig, ExtractSubAgentMiddleware, InferDeepAgentSubagents, InferSubagentByName, InferSubagentState, InferSubagentNames, SubagentStateMap, BaseSubagentState } from \"../ui/types.js\";\nimport type { BagTemplate } from \"../types.template.js\";\nimport type { StreamEvent } from \"../types.js\";\nexport type { GetUpdateType, GetConfigurableType, GetInterruptType, GetToolCallsType, MessageMetadata, UseStreamThread, UseStreamOptions, UseStreamTransport, UseStreamCustomOptions, SubmitOptions, CustomSubmitOptions, RunCallbackMeta, SubagentStream, StreamBase, DefaultSubagentStates, SubAgentLike, CompiledSubAgentLike, DeepAgentTypeConfigLike, IsDeepAgentLike, ExtractDeepAgentConfig, ExtractSubAgentMiddleware, InferDeepAgentSubagents, InferSubagentByName, InferSubagentState, InferSubagentNames, SubagentStateMap, BaseSubagentState, };\nexport interface UseStream<StateType extends Record<string, unknown> = Record<string, unknown>, Bag extends BagTemplate = BagTemplate, SubagentStates extends Record<string, unknown> = DefaultSubagentStates> extends StreamBase<StateType, GetToolCallsType<StateType>, GetInterruptType<Bag>, SubagentStates> {\n /**\n * Whether the thread is currently being loaded.\n */\n isThreadLoading: boolean;\n /**\n * Stops the stream.\n */\n stop: () => Promise<void>;\n /**\n * Create and stream a run to the thread.\n */\n submit: (values: GetUpdateType<Bag, StateType> | null | undefined, options?: SubmitOptions<StateType, GetConfigurableType<Bag>>) => Promise<void>;\n /**\n * The current branch of the thread.\n */\n branch: string;\n /**\n * Set the branch of the thread.\n */\n setBranch: (branch: string) => void;\n /**\n * Flattened history of thread states of a thread.\n */\n history: ThreadState<StateType>[];\n /**\n * Tree of all branches for the thread.\n * @experimental\n */\n experimental_branchTree: Sequence<StateType>;\n /**\n * Get the metadata for a message, such as first thread state the message\n * was seen in and branch information.\n *\n * @param message - The message to get the metadata for.\n * @param index - The index of the message in the thread.\n * @returns The metadata for the message.\n */\n getMessagesMetadata: (message: Message<GetToolCallsType<StateType>>, index?: number) => MessageMetadata<StateType> | undefined;\n /**\n * LangGraph SDK client used to send request and receive responses.\n */\n client: Client;\n /**\n * The ID of the assistant to use.\n */\n assistantId: string;\n /**\n * Join an active stream.\n */\n joinStream: (runId: string, lastEventId?: string, options?: {\n streamMode?: StreamMode | StreamMode[];\n filter?: (event: {\n id?: string;\n event: StreamEvent;\n data: unknown;\n }) => boolean;\n }) => Promise<void>;\n}\nexport type UseStreamCustom<StateType extends Record<string, unknown> = Record<string, unknown>, Bag extends BagTemplate = BagTemplate, SubagentStates extends Record<string, unknown> = DefaultSubagentStates> = Pick<UseStream<StateType, Bag, SubagentStates>, \"values\" | \"error\" | \"isLoading\" | \"stop\" | \"interrupt\" | \"messages\" | \"toolCalls\" | \"getToolCalls\" | \"subagents\" | \"activeSubagents\" | \"getSubagent\" | \"getSubagentsByType\" | \"getSubagentsByMessage\"> & {\n submit: (values: GetUpdateType<Bag, StateType> | null | undefined, options?: CustomSubmitOptions<StateType, GetConfigurableType<Bag>>) => Promise<void>;\n};\n"],"mappings":";;;;;;;;;;UASiBkC,4BAA4BC,0BAA0BA,qCAAqCH,cAAcA,oCAAoCG,0BAA0BhB,+BAA+BD,WAAWkB,WAAW5B,iBAAiB4B,YAAY7B,iBAAiB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CAAAA,EAAAA,GAAAA,OAAAA;KAA+BC,GAH1HE,OAG0HF,CAAAA,IAAAA,CAAAA;;AAAnDtB,KADrEyB,eACqEzB,CAAAA,kBADnCoB,MACmCpB,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,GADToB,MACSpB,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,EAAAA,YAD4BiB,WAC5BjB,GAD0CiB,WAC1CjB,EAAAA,uBAD8EoB,MAC9EpB,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,GADwGI,qBACxGJ,CAAAA,GADiI0B,IACjI1B,CADsImB,SACtInB,CADgJqB,SAChJrB,EAD2JsB,GAC3JtB,EADgKuB,cAChKvB,CAAAA,EAAAA,QAAAA,GAAAA,OAAAA,GAAAA,WAAAA,GAAAA,MAAAA,GAAAA,WAAAA,GAAAA,UAAAA,GAAAA,WAAAA,GAAAA,cAAAA,GAAAA,WAAAA,GAAAA,iBAAAA,GAAAA,aAAAA,GAAAA,oBAAAA,GAAAA,uBAAAA,CAAAA,GAAAA;QAA6DwB,EAAAA,CAAAA,MAAAA,EAAzHlC,aAAyHkC,CAA3GF,GAA2GE,EAAtGH,SAAsGG,CAAAA,GAAAA,IAAAA,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,EAA7DxB,mBAA6DwB,CAAzCH,SAAyCG,EAA9BjC,mBAA8BiC,CAAVF,GAAUE,CAAAA,CAAAA,EAAAA,GAAAA,OAAAA,CAAAA,IAAAA,CAAAA;CAAO"}
1
+ {"version":3,"file":"types.d.ts","names":["Client","ThreadState","Message","StreamMode","Sequence","GetUpdateType","GetConfigurableType","GetInterruptType","GetToolCallsType","MessageMetadata","UseStreamThread","UseStreamOptions","UseStreamTransport","UseStreamCustomOptions","SubmitOptions","CustomSubmitOptions","RunCallbackMeta","SubagentStream","StreamBase","DefaultSubagentStates","SubAgentLike","CompiledSubAgentLike","DeepAgentTypeConfigLike","IsDeepAgentLike","ExtractDeepAgentConfig","ExtractSubAgentMiddleware","InferDeepAgentSubagents","InferSubagentByName","InferSubagentState","InferSubagentNames","SubagentStateMap","BaseSubagentState","BagTemplate","StreamEvent","UseStream","Record","StateType","Bag","SubagentStates","Promise","UseStreamCustom","Pick"],"sources":["../../src/react/types.d.ts"],"sourcesContent":["import type { Client } from \"../client.js\";\nimport type { ThreadState } from \"../schema.js\";\nimport type { Message } from \"../types.messages.js\";\nimport type { StreamMode } from \"../types.stream.js\";\nimport type { Sequence } from \"../ui/branching.js\";\nimport type { GetUpdateType, GetConfigurableType, GetInterruptType, GetToolCallsType, MessageMetadata, UseStreamThread, UseStreamOptions, UseStreamTransport, UseStreamCustomOptions, SubmitOptions, CustomSubmitOptions, RunCallbackMeta, SubagentStream, StreamBase, DefaultSubagentStates, SubAgentLike, CompiledSubAgentLike, DeepAgentTypeConfigLike, IsDeepAgentLike, ExtractDeepAgentConfig, ExtractSubAgentMiddleware, InferDeepAgentSubagents, InferSubagentByName, InferSubagentState, InferSubagentNames, SubagentStateMap, BaseSubagentState } from \"../ui/types.js\";\nimport type { BagTemplate } from \"../types.template.js\";\nimport type { StreamEvent } from \"../types.js\";\nexport type { GetUpdateType, GetConfigurableType, GetInterruptType, GetToolCallsType, MessageMetadata, UseStreamThread, UseStreamOptions, UseStreamTransport, UseStreamCustomOptions, SubmitOptions, CustomSubmitOptions, RunCallbackMeta, SubagentStream, StreamBase, DefaultSubagentStates, SubAgentLike, CompiledSubAgentLike, DeepAgentTypeConfigLike, IsDeepAgentLike, ExtractDeepAgentConfig, ExtractSubAgentMiddleware, InferDeepAgentSubagents, InferSubagentByName, InferSubagentState, InferSubagentNames, SubagentStateMap, BaseSubagentState, };\nexport interface UseStream<StateType extends Record<string, unknown> = Record<string, unknown>, Bag extends BagTemplate = BagTemplate, SubagentStates extends Record<string, unknown> = DefaultSubagentStates> extends StreamBase<StateType, GetToolCallsType<StateType>, GetInterruptType<Bag>, SubagentStates> {\n /**\n * Whether the thread is currently being loaded.\n */\n isThreadLoading: boolean;\n /**\n * Stops the stream.\n */\n stop: () => Promise<void>;\n /**\n * Create and stream a run to the thread.\n */\n submit: (values: GetUpdateType<Bag, StateType> | null | undefined, options?: SubmitOptions<StateType, GetConfigurableType<Bag>>) => Promise<void>;\n /**\n * The current branch of the thread.\n */\n branch: string;\n /**\n * Set the branch of the thread.\n */\n setBranch: (branch: string) => void;\n /**\n * Flattened history of thread states of a thread.\n */\n history: ThreadState<StateType>[];\n /**\n * Tree of all branches for the thread.\n * @experimental\n */\n experimental_branchTree: Sequence<StateType>;\n /**\n * Get the metadata for a message, such as first thread state the message\n * was seen in and branch information.\n *\n * @param message - The message to get the metadata for.\n * @param index - The index of the message in the thread.\n * @returns The metadata for the message.\n */\n getMessagesMetadata: (message: Message<GetToolCallsType<StateType>>, index?: number) => MessageMetadata<StateType> | undefined;\n /**\n * LangGraph SDK client used to send request and receive responses.\n */\n client: Client;\n /**\n * The ID of the assistant to use.\n */\n assistantId: string;\n /**\n * Join an active stream.\n */\n joinStream: (runId: string, lastEventId?: string, options?: {\n streamMode?: StreamMode | StreamMode[];\n filter?: (event: {\n id?: string;\n event: StreamEvent;\n data: unknown;\n }) => boolean;\n }) => Promise<void>;\n}\nexport type UseStreamCustom<StateType extends Record<string, unknown> = Record<string, unknown>, Bag extends BagTemplate = BagTemplate, SubagentStates extends Record<string, unknown> = DefaultSubagentStates> = Pick<UseStream<StateType, Bag, SubagentStates>, \"values\" | \"error\" | \"isLoading\" | \"stop\" | \"interrupt\" | \"interrupts\" | \"messages\" | \"toolCalls\" | \"getToolCalls\" | \"subagents\" | \"activeSubagents\" | \"getSubagent\" | \"getSubagentsByType\" | \"getSubagentsByMessage\"> & {\n submit: (values: GetUpdateType<Bag, StateType> | null | undefined, options?: CustomSubmitOptions<StateType, GetConfigurableType<Bag>>) => Promise<void>;\n};\n"],"mappings":";;;;;;;;;;UASiBkC,4BAA4BC,0BAA0BA,qCAAqCH,cAAcA,oCAAoCG,0BAA0BhB,+BAA+BD,WAAWkB,WAAW5B,iBAAi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AA,OAAAA;IAAgF+B,CAAAA,EAAAA,GAAAA,OAAAA;KAA+BC,GAH1HE,OAG0HF,CAAAA,IAAAA,CAAAA;;AAAnDtB,KADrEyB,eACqEzB,CAAAA,kBADnCoB,MACmCpB,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,GADToB,MACSpB,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,EAAAA,YAD4BiB,WAC5BjB,GAD0CiB,WAC1CjB,EAAAA,uBAD8EoB,MAC9EpB,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,GADwGI,qBACxGJ,CAAAA,GADiI0B,IACjI1B,CADsImB,SACtInB,CADgJqB,SAChJrB,EAD2JsB,GAC3JtB,EADgKuB,cAChKvB,CAAAA,EAAAA,QAAAA,GAAAA,OAAAA,GAAAA,WAAAA,GAAAA,MAAAA,GAAAA,WAAAA,GAAAA,YAAAA,GAAAA,UAAAA,GAAAA,WAAAA,GAAAA,cAAAA,GAAAA,WAAAA,GAAAA,iBAAAA,GAAAA,aAAAA,GAAAA,oBAAAA,GAAAA,uBAAAA,CAAAA,GAAAA;QAA6DwB,EAAAA,CAAAA,MAAAA,EAAzHlC,aAAyHkC,CAA3GF,GAA2GE,EAAtGH,SAAsGG,CAAAA,GAAAA,IAAAA,GAAAA,SAAAA,EAAAA,OAAAA,CAAAA,EAA7DxB,mBAA6DwB,CAAzCH,SAAyCG,EAA9BjC,mBAA8BiC,CAAVF,GAAUE,CAAAA,CAAAA,EAAAA,GAAAA,OAAAA,CAAAA,IAAAA,CAAAA;CAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","names":["JSONSchema7","Optional","T","RunStatus","ThreadStatus","MultitaskStrategy","CancelAction","Config","GraphSchema","Subgraphs","Record","Metadata","AssistantBase","AssistantVersion","Assistant","AssistantsSearchResponse","AssistantGraph","Array","Interrupt","TValue","Thread","DefaultValues","ValuesType","TInterruptValue","Cron","ThreadValuesFilter","ThreadState","Checkpoint","ThreadTask","Run","ListNamespaceResponse","Item","SearchItem","SearchItemsResponse","CronCreateResponse","CronCreateForThreadResponse","Omit","AssistantSortBy","ThreadSortBy","CronSortBy","SortOrder","AssistantSelectField","ThreadSelectField","RunSelectField","CronSelectField"],"sources":["../src/schema.d.ts"],"sourcesContent":["import type { JSONSchema7 } from \"json-schema\";\ntype Optional<T> = T | null | undefined;\nexport type RunStatus = \"pending\" | \"running\" | \"error\" | \"success\" | \"timeout\" | \"interrupted\";\nexport type ThreadStatus = \"idle\" | \"busy\" | \"interrupted\" | \"error\";\ntype MultitaskStrategy = \"reject\" | \"interrupt\" | \"rollback\" | \"enqueue\";\nexport type CancelAction = \"interrupt\" | \"rollback\";\nexport type Config = {\n /**\n * Tags for this call and any sub-calls (eg. a Chain calling an LLM).\n * You can use these to filter calls.\n */\n tags?: string[];\n /**\n * Maximum number of times a call can recurse.\n * If not provided, defaults to 25.\n */\n recursion_limit?: number;\n /**\n * Runtime values for attributes previously made configurable on this Runnable.\n */\n configurable?: {\n /**\n * ID of the thread\n */\n thread_id?: Optional<string>;\n /**\n * Timestamp of the state checkpoint\n */\n checkpoint_id?: Optional<string>;\n [key: string]: unknown;\n };\n};\nexport interface GraphSchema {\n /**\n * The ID of the graph.\n */\n graph_id: string;\n /**\n * The schema for the input state.\n * Missing if unable to generate JSON schema from graph.\n */\n input_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the output state.\n * Missing if unable to generate JSON schema from graph.\n */\n output_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph state.\n * Missing if unable to generate JSON schema from graph.\n */\n state_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph config.\n * Missing if unable to generate JSON schema from graph.\n */\n config_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph context.\n * Missing if unable to generate JSON schema from graph.\n */\n context_schema?: JSONSchema7 | null | undefined;\n}\nexport type Subgraphs = Record<string, GraphSchema>;\nexport type Metadata = Optional<{\n source?: \"input\" | \"loop\" | \"update\" | (string & {});\n step?: number;\n writes?: Record<string, unknown> | null;\n parents?: Record<string, string>;\n [key: string]: unknown;\n}>;\nexport interface AssistantBase {\n /** The ID of the assistant. */\n assistant_id: string;\n /** The ID of the graph. */\n graph_id: string;\n /** The assistant config. */\n config: Config;\n /** The assistant context. */\n context: unknown;\n /** The time the assistant was created. */\n created_at: string;\n /** The assistant metadata. */\n metadata: Metadata;\n /** The version of the assistant. */\n version: number;\n /** The name of the assistant */\n name: string;\n /** The description of the assistant */\n description?: string;\n}\nexport interface AssistantVersion extends AssistantBase {\n}\nexport interface Assistant extends AssistantBase {\n /** The last time the assistant was updated. */\n updated_at: string;\n}\nexport interface AssistantsSearchResponse {\n /** The assistants returned for the current search page. */\n assistants: Assistant[];\n /** Pagination cursor from the X-Pagination-Next response header. */\n next: string | null;\n}\nexport interface AssistantGraph {\n nodes: Array<{\n id: string | number;\n name?: string;\n data?: Record<string, any> | string;\n metadata?: unknown;\n }>;\n edges: Array<{\n source: string;\n target: string;\n data?: string;\n conditional?: boolean;\n }>;\n}\n/**\n * An interrupt thrown inside a thread.\n */\nexport interface Interrupt<TValue = unknown> {\n /**\n * The ID of the interrupt.\n */\n id?: string;\n /**\n * The value of the interrupt.\n */\n value?: TValue;\n /**\n * Will be deprecated in the future.\n * @deprecated Will be removed in the future.\n */\n when?: \"during\" | (string & {});\n /**\n * Whether the interrupt can be resumed.\n * @deprecated Will be removed in the future.\n */\n resumable?: boolean;\n /**\n * The namespace of the interrupt.\n * @deprecated Replaced by `interrupt_id`\n */\n ns?: string[];\n}\nexport interface Thread<ValuesType = DefaultValues, TInterruptValue = unknown> {\n /** The ID of the thread. */\n thread_id: string;\n /** The time the thread was created. */\n created_at: string;\n /** The last time the thread was updated. */\n updated_at: string;\n /** The thread metadata. */\n metadata: Metadata;\n /** The status of the thread */\n status: ThreadStatus;\n /** The current state of the thread. */\n values: ValuesType;\n /** Interrupts which were thrown in this thread */\n interrupts: Record<string, Array<Interrupt<TInterruptValue>>>;\n /** The config for the thread */\n config?: Config;\n /** The error for the thread (if status == \"error\") */\n error?: Optional<string | Record<string, unknown>>;\n}\nexport interface Cron {\n /** The ID of the cron */\n cron_id: string;\n /** The ID of the assistant */\n assistant_id: string;\n /** The ID of the thread */\n thread_id: Optional<string>;\n /** What to do with the thread after the run completes. Only applicable for stateless crons. */\n on_run_completed?: \"delete\" | \"keep\";\n /** The end date to stop running the cron. */\n end_time: Optional<string>;\n /** The schedule to run, cron format. Schedules are interpreted in UTC. */\n schedule: string;\n /** The time the cron was created. */\n created_at: string;\n /** The last time the cron was updated. */\n updated_at: string;\n /** The run payload to use for creating new run. */\n payload: Record<string, unknown>;\n /** The user ID of the cron */\n user_id: Optional<string>;\n /** The next run date of the cron */\n next_run_date: Optional<string>;\n /** The metadata of the cron */\n metadata: Record<string, unknown>;\n /** Whether the cron is enabled */\n enabled: boolean;\n}\nexport type DefaultValues = Record<string, unknown>[] | Record<string, unknown>;\nexport type ThreadValuesFilter = Record<string, unknown>;\nexport interface ThreadState<ValuesType = DefaultValues> {\n /** The state values */\n values: ValuesType;\n /** The next nodes to execute. If empty, the thread is done until new input is received */\n next: string[];\n /** Checkpoint of the thread state */\n checkpoint: Checkpoint;\n /** Metadata for this state */\n metadata: Metadata;\n /** Time of state creation */\n created_at: Optional<string>;\n /** The parent checkpoint. If missing, this is the root checkpoint */\n parent_checkpoint: Optional<Checkpoint>;\n /** Tasks to execute in this step. If already attempted, may contain an error */\n tasks: Array<ThreadTask>;\n}\nexport interface ThreadTask<ValuesType = DefaultValues, TInterruptValue = unknown> {\n id: string;\n name: string;\n result?: unknown;\n error: Optional<string>;\n interrupts: Array<Interrupt<TInterruptValue>>;\n checkpoint: Optional<Checkpoint>;\n state: Optional<ThreadState<ValuesType>>;\n}\nexport interface Run {\n /** The ID of the run */\n run_id: string;\n /** The ID of the thread */\n thread_id: string;\n /** The assistant that wwas used for this run */\n assistant_id: string;\n /** The time the run was created */\n created_at: string;\n /** The last time the run was updated */\n updated_at: string;\n /** The status of the run. */\n status: RunStatus;\n /** Run metadata */\n metadata: Metadata;\n /** Strategy to handle concurrent runs on the same thread */\n multitask_strategy: Optional<MultitaskStrategy>;\n}\nexport type Checkpoint = {\n thread_id: string;\n checkpoint_ns: string;\n checkpoint_id: Optional<string>;\n checkpoint_map: Optional<Record<string, unknown>>;\n};\nexport interface ListNamespaceResponse {\n namespaces: string[][];\n}\nexport interface Item {\n namespace: string[];\n key: string;\n value: Record<string, any>;\n createdAt: string;\n updatedAt: string;\n}\nexport interface SearchItem extends Item {\n score?: number;\n}\nexport interface SearchItemsResponse {\n items: SearchItem[];\n}\nexport interface CronCreateResponse {\n cron_id: string;\n assistant_id: string;\n thread_id: string | undefined;\n user_id: string;\n payload: Record<string, unknown>;\n schedule: string;\n next_run_date: string;\n end_time: string | undefined;\n created_at: string;\n updated_at: string;\n metadata: Metadata;\n}\nexport interface CronCreateForThreadResponse extends Omit<CronCreateResponse, \"thread_id\"> {\n thread_id: string;\n}\nexport type AssistantSortBy = \"assistant_id\" | \"graph_id\" | \"name\" | \"created_at\" | \"updated_at\";\nexport type ThreadSortBy = \"thread_id\" | \"status\" | \"created_at\" | \"updated_at\";\nexport type CronSortBy = \"cron_id\" | \"assistant_id\" | \"thread_id\" | \"created_at\" | \"updated_at\" | \"next_run_date\";\nexport type SortOrder = \"asc\" | \"desc\";\nexport type AssistantSelectField = \"assistant_id\" | \"graph_id\" | \"name\" | \"description\" | \"config\" | \"context\" | \"created_at\" | \"updated_at\" | \"metadata\" | \"version\";\nexport type ThreadSelectField = \"thread_id\" | \"created_at\" | \"updated_at\" | \"metadata\" | \"config\" | \"context\" | \"status\" | \"values\" | \"interrupts\";\nexport type RunSelectField = \"run_id\" | \"thread_id\" | \"assistant_id\" | \"created_at\" | \"updated_at\" | \"status\" | \"metadata\" | \"kwargs\" | \"multitask_strategy\";\nexport type CronSelectField = \"cron_id\" | \"assistant_id\" | \"thread_id\" | \"end_time\" | \"schedule\" | \"created_at\" | \"updated_at\" | \"user_id\" | \"payload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RunStatus","ThreadStatus","MultitaskStrategy","CancelAction","Config","GraphSchema","Subgraphs","Record","Metadata","AssistantBase","AssistantVersion","Assistant","AssistantsSearchResponse","AssistantGraph","Array","Interrupt","TValue","Thread","DefaultValues","ValuesType","TInterruptValue","Cron","ThreadValuesFilter","ThreadState","Checkpoint","ThreadTask","Run","ListNamespaceResponse","Item","SearchItem","SearchItemsResponse","CronCreateResponse","CronCreateForThreadResponse","Omit","AssistantSortBy","ThreadSortBy","CronSortBy","SortOrder","AssistantSelectField","ThreadSelectField","RunSelectField","CronSelectField"],"sources":["../src/schema.d.ts"],"sourcesContent":["import type { JSONSchema7 } from \"json-schema\";\ntype Optional<T> = T | null | undefined;\nexport type RunStatus = \"pending\" | \"running\" | \"error\" | \"success\" | \"timeout\" | \"interrupted\";\nexport type ThreadStatus = \"idle\" | \"busy\" | \"interrupted\" | \"error\";\ntype MultitaskStrategy = \"reject\" | \"interrupt\" | \"rollback\" | \"enqueue\";\nexport type CancelAction = \"interrupt\" | \"rollback\";\nexport type Config = {\n /**\n * Tags for this call and any sub-calls (eg. a Chain calling an LLM).\n * You can use these to filter calls.\n */\n tags?: string[];\n /**\n * Maximum number of times a call can recurse.\n * If not provided, defaults to 25.\n */\n recursion_limit?: number;\n /**\n * Runtime values for attributes previously made configurable on this Runnable.\n */\n configurable?: {\n /**\n * ID of the thread\n */\n thread_id?: Optional<string>;\n /**\n * Timestamp of the state checkpoint\n */\n checkpoint_id?: Optional<string>;\n [key: string]: unknown;\n };\n};\nexport interface GraphSchema {\n /**\n * The ID of the graph.\n */\n graph_id: string;\n /**\n * The schema for the input state.\n * Missing if unable to generate JSON schema from graph.\n */\n input_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the output state.\n * Missing if unable to generate JSON schema from graph.\n */\n output_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph state.\n * Missing if unable to generate JSON schema from graph.\n */\n state_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph config.\n * Missing if unable to generate JSON schema from graph.\n */\n config_schema?: JSONSchema7 | null | undefined;\n /**\n * The schema for the graph context.\n * Missing if unable to generate JSON schema from graph.\n */\n context_schema?: JSONSchema7 | null | undefined;\n}\nexport type Subgraphs = Record<string, GraphSchema>;\nexport type Metadata = Optional<{\n source?: \"input\" | \"loop\" | \"update\" | (string & {});\n step?: number;\n writes?: Record<string, unknown> | null;\n parents?: Record<string, string>;\n [key: string]: unknown;\n}>;\nexport interface AssistantBase {\n /** The ID of the assistant. */\n assistant_id: string;\n /** The ID of the graph. */\n graph_id: string;\n /** The assistant config. */\n config: Config;\n /** The assistant context. */\n context: unknown;\n /** The time the assistant was created. */\n created_at: string;\n /** The assistant metadata. */\n metadata: Metadata;\n /** The version of the assistant. */\n version: number;\n /** The name of the assistant */\n name: string;\n /** The description of the assistant */\n description?: string;\n}\nexport interface AssistantVersion extends AssistantBase {\n}\nexport interface Assistant extends AssistantBase {\n /** The last time the assistant was updated. */\n updated_at: string;\n}\nexport interface AssistantsSearchResponse {\n /** The assistants returned for the current search page. */\n assistants: Assistant[];\n /** Pagination cursor from the X-Pagination-Next response header. */\n next: string | null;\n}\nexport interface AssistantGraph {\n nodes: Array<{\n id: string | number;\n name?: string;\n data?: Record<string, any> | string;\n metadata?: unknown;\n }>;\n edges: Array<{\n source: string;\n target: string;\n data?: string;\n conditional?: boolean;\n }>;\n}\n/**\n * An interrupt thrown inside a thread.\n */\nexport interface Interrupt<TValue = unknown> {\n /**\n * The ID of the interrupt.\n */\n id?: string;\n /**\n * The value of the interrupt.\n */\n value?: TValue;\n /**\n * Will be deprecated in the future.\n * @deprecated Will be removed in the future.\n */\n when?: \"during\" | (string & {});\n /**\n * Whether the interrupt can be resumed.\n * @deprecated Will be removed in the future.\n */\n resumable?: boolean;\n /**\n * The namespace of the interrupt.\n * @deprecated Replaced by `interrupt_id`\n */\n ns?: string[];\n}\nexport interface Thread<ValuesType = DefaultValues, TInterruptValue = unknown> {\n /** The ID of the thread. */\n thread_id: string;\n /** The time the thread was created. */\n created_at: string;\n /** The last time the thread was updated. */\n updated_at: string;\n /** The thread metadata. */\n metadata: Metadata;\n /** The status of the thread */\n status: ThreadStatus;\n /** The current state of the thread. */\n values: ValuesType;\n /** Interrupts which were thrown in this thread */\n interrupts: Record<string, Array<Interrupt<TInterruptValue>>>;\n /** The config for the thread */\n config?: Config;\n /** The error for the thread (if status == \"error\") */\n error?: Optional<string | Record<string, unknown>>;\n}\nexport interface Cron {\n /** The ID of the cron */\n cron_id: string;\n /** The ID of the assistant */\n assistant_id: string;\n /** The ID of the thread */\n thread_id: Optional<string>;\n /** What to do with the thread after the run completes. Only applicable for stateless crons. */\n on_run_completed?: \"delete\" | \"keep\";\n /** The end date to stop running the cron. */\n end_time: Optional<string>;\n /** The schedule to run, cron format. Schedules are interpreted in UTC. */\n schedule: string;\n /** The time the cron was created. */\n created_at: string;\n /** The last time the cron was updated. */\n updated_at: string;\n /** The run payload to use for creating new run. */\n payload: Record<string, unknown>;\n /** The user ID of the cron */\n user_id: Optional<string>;\n /** The next run date of the cron */\n next_run_date: Optional<string>;\n /** The metadata of the cron */\n metadata: Record<string, unknown>;\n /** Whether the cron is enabled */\n enabled: boolean;\n}\nexport type DefaultValues = Record<string, unknown>[] | Record<string, unknown>;\nexport type ThreadValuesFilter = Record<string, unknown>;\nexport interface ThreadState<ValuesType = DefaultValues> {\n /** The state values */\n values: ValuesType;\n /** The next nodes to execute. If empty, the thread is done until new input is received */\n next: string[];\n /** Checkpoint of the thread state */\n checkpoint: Checkpoint;\n /** Metadata for this state */\n metadata: Metadata;\n /** Time of state creation */\n created_at: Optional<string>;\n /** The parent checkpoint. If missing, this is the root checkpoint */\n parent_checkpoint: Optional<Checkpoint>;\n /** Tasks to execute in this step. If already attempted, may contain an error */\n tasks: Array<ThreadTask>;\n}\nexport interface ThreadTask<ValuesType = DefaultValues, TInterruptValue = unknown> {\n id: string;\n name: string;\n result?: unknown;\n error: Optional<string>;\n interrupts: Array<Interrupt<TInterruptValue>>;\n checkpoint: Optional<Checkpoint>;\n state: Optional<ThreadState<ValuesType>>;\n}\nexport interface Run {\n /** The ID of the run */\n run_id: string;\n /** The ID of the thread */\n thread_id: string;\n /** The assistant that wwas used for this run */\n assistant_id: string;\n /** The time the run was created */\n created_at: string;\n /** The last time the run was updated */\n updated_at: string;\n /** The status of the run. */\n status: RunStatus;\n /** Run metadata */\n metadata: Metadata;\n /** Strategy to handle concurrent runs on the same thread */\n multitask_strategy: Optional<MultitaskStrategy>;\n}\nexport type Checkpoint = {\n thread_id: string;\n checkpoint_ns: string;\n checkpoint_id: Optional<string>;\n checkpoint_map: Optional<Record<string, unknown>>;\n};\nexport interface ListNamespaceResponse {\n namespaces: string[][];\n}\nexport interface Item {\n namespace: string[];\n key: string;\n value: Record<string, any>;\n createdAt: string;\n updatedAt: string;\n}\nexport interface SearchItem extends Item {\n score?: number;\n}\nexport interface SearchItemsResponse {\n items: SearchItem[];\n}\nexport interface CronCreateResponse {\n cron_id: string;\n assistant_id: string;\n thread_id: string | undefined;\n user_id: string;\n payload: Record<string, unknown>;\n schedule: string;\n next_run_date: string;\n end_time: string | undefined;\n created_at: string;\n updated_at: string;\n metadata: Metadata;\n}\nexport interface CronCreateForThreadResponse extends Omit<CronCreateResponse, \"thread_id\"> {\n thread_id: string;\n}\nexport type AssistantSortBy = \"assistant_id\" | \"graph_id\" | \"name\" | \"created_at\" | \"updated_at\";\nexport type ThreadSortBy = \"thread_id\" | \"status\" | \"created_at\" | \"updated_at\";\nexport type CronSortBy = \"cron_id\" | \"assistant_id\" | \"thread_id\" | \"created_at\" | \"updated_at\" | \"next_run_date\";\nexport type SortOrder = \"asc\" | \"desc\";\nexport type AssistantSelectField = \"assistant_id\" | \"graph_id\" | \"name\" | \"description\" | \"config\" | \"context\" | \"created_at\" | \"updated_at\" | \"metadata\" | \"version\";\nexport type ThreadSelectField = \"thread_id\" | \"created_at\" | \"updated_at\" | \"metadata\" | \"config\" | \"context\" | \"status\" | \"values\" | \"interrupts\";\nexport type RunSelectField = \"run_id\" | \"thread_id\" | \"assistant_id\" | \"created_at\" | \"updated_at\" | \"status\" | \"metadata\" | \"kwargs\" | \"multitask_strategy\";\nexport type CronSelectField = \"cron_id\" | \"assistant_id\" | \"thread_id\" | \"end_time\" | \"schedule\" | \"created_at\" | \"updated_at\" | \"user_id\" | \"payload\" | \"next_run_date\" | \"metadata\" | \"now\";\nexport {};\n"],"mappings":";;;KACKC,cAAcC;KACPC,SAAAA;AADPF,KAEOG,YAAAA,GAFOF,MAAC,GAAA,MAAA,GAAA,aAAA,GAAA,OAAA;AACpB,KAEKG,iBAAAA,GAFgB,QAAA,GAAA,WAAA,GAAA,UAAA,GAAA,SAAA;AACTD,KAEAE,YAAAA,GAFY,WAAA,GAAA,UAAA;AACnBD,KAEOE,MAAAA,GAFPF;EACOC;AACZ;;;MAsBwBL,CAAAA,EAAAA,MAAAA,EAAAA;EAAQ;AAIhC;;;iBAcoBD,CAAAA,EAAAA,MAAAA;;;;EAeY,YAAA,CAAA,EAAA;IAEpBS;;;IAAYC,SAAAA,CAAAA,EAvCJT,QAuCIS,CAAAA,MAAAA,CAAAA;IAAM;AAC9B;;IAGaA,aAAAA,CAAAA,EAvCWT,QAuCXS,CAAAA,MAAAA,CAAAA;IACCA,CAAAA,GAAAA,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;;CAJiB;AAOdE,UAvCAJ,WAAAA,CAuCa;EAAA;;;EAYR,QAAA,EAAA,MAAA;EAQLK;AAEjB;AAIA;AAMA;EAA+B,YAAA,CAAA,EA9DZb,WA8DY,GAAA,IAAA,GAAA,SAAA;;;;;EAiBdkB,aAAS,CAAA,EA1ENlB,WAkFRmB,GAAAA,IAAM,GAAA,SAAA;EAiBDC;;;;cAULhB,CAAAA,EAxGOJ,WAwGPI,GAAAA,IAAAA,GAAAA,SAAAA;;;;;eAIIM,CAAAA,EAvGIV,WAuGJU,GAAAA,IAAAA,GAAAA,SAAAA;;;;;EAMCc,cAAI,CAAA,EAxG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xB;;;;;;YAMCC;;UAEGwB,2BAAAA,SAAoCC,KAAKF;;;KAG9CG,eAAAA;KACAC,YAAAA;KACAC,UAAAA;KACAC,SAAAA;KACAC,oBAAAA;KACAC,iBAAAA;KACAC,cAAAA;KACAC,eAAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.stream.d.cts","names":["Message","Interrupt","Metadata","Config","ThreadTask","StreamMode","ThreadStreamMode","MessageTupleMetadata","AsSubgraph","TEvent","ValuesStreamEvent","StateType","SubgraphValuesStreamEvent","MessagesTupleStreamEvent","SubgraphMessagesTupleStreamEvent","MetadataStreamEvent","ErrorStreamEvent","SubgraphErrorStreamEvent","UpdatesStreamEvent","UpdateType","SubgraphUpdatesStreamEvent","CustomStreamEvent","T","SubgraphCustomStreamEvent","MessagesMetadataStreamEvent","MessagesCompleteStreamEvent","MessagesPartialStreamEvent","TasksStreamCreateEvent","TasksStreamResultEvent","TasksStreamErrorEvent","TasksStreamEvent","SubgraphTasksStreamEvent","CheckpointsStreamEvent","SubgraphCheckpointsStreamEvent","MessagesStreamEvent","SubgraphMessagesStreamEvent","DebugStreamEvent","SubgraphDebugStreamEvent","EventsStreamEvent","Record","SubgraphEventsStreamEvent","FeedbackStreamEvent","GetStreamModeMap","TStateType","TUpdateType","TCustomType","TStreamMode","GetSubgraphsStreamModeMap","TypedAsyncGenerator","TSubgraphs","AsyncGenerator"],"sources":["../src/types.stream.d.ts"],"sourcesContent":["import type { Message } from \"./types.messages.js\";\nimport type { Interrupt, Metadata, Config, ThreadTask } from \"./schema.js\";\n/**\nimport type { SubgraphCheckpointsStreamEvent } from \"./types.stream.subgraph.js\";\n * Stream modes\n * - \"values\": Stream only the state values.\n * - \"messages\": Stream complete messages.\n * - \"messages-tuple\": Stream (message chunk, metadata) tuples.\n * - \"updates\": Stream updates to the state.\n * - \"events\": Stream events occurring during execution.\n * - \"debug\": Stream detailed debug information.\n * - \"custom\": Stream custom events.\n */\nexport type StreamMode = \"values\" | \"messages\" | \"updates\" | \"events\" | \"debug\" | \"tasks\" | \"checkpoints\" | \"custom\" | \"messages-tuple\";\nexport type ThreadStreamMode = \"run_modes\" | \"lifecycle\" | \"state_update\";\ntype MessageTupleMetadata = {\n tags: string[];\n [key: string]: unknown;\n};\ntype AsSubgraph<TEvent extends {\n id?: string;\n event: string;\n data: unknown;\n}> = {\n id?: TEvent[\"id\"];\n event: TEvent[\"event\"] | `${TEvent[\"event\"]}|${string}`;\n data: TEvent[\"data\"];\n};\n/**\n * Stream event with values after completion of each step.\n */\nexport type ValuesStreamEvent<StateType> = {\n id?: string;\n event: \"values\";\n data: StateType;\n};\n/** @internal */\nexport type SubgraphValuesStreamEvent<StateType> = AsSubgraph<ValuesStreamEvent<StateType>>;\n/**\n * Stream event with message chunks coming from LLM invocations inside nodes.\n */\nexport type MessagesTupleStreamEvent = {\n event: \"messages\";\n data: [message: Message, config: MessageTupleMetadata];\n};\n/** @internal */\nexport type SubgraphMessagesTupleStreamEvent = AsSubgraph<MessagesTupleStreamEvent>;\n/**\n * Metadata stream event with information about the run and thread\n */\nexport type MetadataStreamEvent = {\n id?: string;\n event: \"metadata\";\n data: {\n run_id: string;\n thread_id: string;\n };\n};\n/**\n * Stream event with error information.\n */\nexport type ErrorStreamEvent = {\n id?: string;\n event: \"error\";\n data: {\n error: string;\n message: string;\n };\n};\n/** @internal */\nexport type SubgraphErrorStreamEvent = AsSubgraph<ErrorStreamEvent>;\n/**\n * Stream event with updates to the state after each step.\n * The streamed outputs include the name of the node that\n * produced the update as well as the update.\n */\nexport type UpdatesStreamEvent<UpdateType> = {\n id?: string;\n event: \"updates\";\n data: {\n [node: string]: UpdateType;\n };\n};\n/** @internal */\nexport type SubgraphUpdatesStreamEvent<UpdateType> = AsSubgraph<UpdatesStreamEvent<UpdateType>>;\n/**\n * Streaming custom data from inside the nodes.\n */\nexport type CustomStreamEvent<T> = {\n event: \"custom\";\n data: T;\n};\n/** @internal */\nexport type SubgraphCustomStreamEvent<T> = AsSubgraph<CustomStreamEvent<T>>;\ntype MessagesMetadataStreamEvent = {\n id?: string;\n event: \"messages/metadata\";\n data: {\n [messageId: string]: {\n metadata: unknown;\n };\n };\n};\ntype MessagesCompleteStreamEvent = {\n id?: string;\n event: \"messages/complete\";\n data: Message[];\n};\ntype MessagesPartialStreamEvent = {\n id?: string;\n event: \"messages/partial\";\n data: Message[];\n};\ntype TasksStreamCreateEvent<StateType> = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n input: StateType;\n triggers: string[];\n };\n};\ntype TasksStreamResultEvent<UpdateType> = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n result: [string, UpdateType][];\n };\n};\ntype TasksStreamErrorEvent = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n error: string;\n };\n};\nexport type TasksStreamEvent<StateType, UpdateType> = TasksStreamCreateEvent<StateType> | TasksStreamResultEvent<UpdateType> | TasksStreamErrorEvent;\ntype SubgraphTasksStreamEvent<StateType, UpdateType> = AsSubgraph<TasksStreamCreateEvent<StateType>> | AsSubgraph<TasksStreamResultEvent<UpdateType>> | AsSubgraph<TasksStreamErrorEvent>;\nexport type CheckpointsStreamEvent<StateType> = {\n id?: string;\n event: \"checkpoints\";\n data: {\n values: StateType;\n next: string[];\n config: Config;\n metadata: Metadata;\n tasks: ThreadTask[];\n };\n};\ntype SubgraphCheckpointsStreamEvent<StateType> = AsSubgraph<CheckpointsStreamEvent<StateType>>;\n/**\n * Message stream event specific to LangGraph Server.\n * @deprecated Use `streamMode: \"messages-tuple\"` instead.\n */\nexport type MessagesStreamEvent = MessagesMetadataStreamEvent | MessagesCompleteStreamEvent | MessagesPartialStreamEvent;\n/** @internal */\nexport type SubgraphMessagesStreamEvent = AsSubgraph<MessagesMetadataStreamEvent> | AsSubgraph<MessagesCompleteStreamEvent> | AsSubgraph<MessagesPartialStreamEvent>;\n/**\n * Stream event with detailed debug information.\n */\nexport type DebugStreamEvent = {\n id?: string;\n event: \"debug\";\n data: unknown;\n};\n/** @internal */\nexport type SubgraphDebugStreamEvent = AsSubgraph<DebugStreamEvent>;\n/**\n * Stream event with events occurring during execution.\n */\nexport type EventsStreamEvent = {\n id?: string;\n event: \"events\";\n data: {\n event: `on_${\"chat_model\" | \"llm\" | \"chain\" | \"tool\" | \"retriever\" | \"prompt\"}_${\"start\" | \"stream\" | \"end\"}` | (string & {});\n name: string;\n tags: string[];\n run_id: string;\n metadata: Record<string, unknown>;\n parent_ids: string[];\n data: unknown;\n };\n};\n/** @internal */\nexport type SubgraphEventsStreamEvent = AsSubgraph<EventsStreamEvent>;\n/**\n * Stream event with a feedback key to signed URL map. Set `feedbackKeys` in\n * the `RunsStreamPayload` to receive this event.\n */\nexport type FeedbackStreamEvent = {\n id?: string;\n event: \"feedback\";\n data: {\n [feedbackKey: string]: string;\n };\n};\ntype GetStreamModeMap<TStreamMode extends StreamMode | StreamMode[], TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = {\n values: ValuesStreamEvent<TStateType>;\n updates: UpdatesStreamEvent<TUpdateType>;\n custom: CustomStreamEvent<TCustomType>;\n debug: DebugStreamEvent;\n messages: MessagesStreamEvent;\n \"messages-tuple\": MessagesTupleStreamEvent;\n tasks: TasksStreamEvent<TStateType, TUpdateType>;\n checkpoints: CheckpointsStreamEvent<TStateType>;\n events: EventsStreamEvent;\n}[TStreamMode extends StreamMode[] ? TStreamMode[number] : TStreamMode] | ErrorStreamEvent | MetadataStreamEvent | FeedbackStreamEvent;\ntype GetSubgraphsStreamModeMap<TStreamMode extends StreamMode | StreamMode[], TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = {\n values: SubgraphValuesStreamEvent<TStateType>;\n updates: SubgraphUpdatesStreamEvent<TUpdateType>;\n custom: SubgraphCustomStreamEvent<TCustomType>;\n debug: SubgraphDebugStreamEvent;\n messages: SubgraphMessagesStreamEvent;\n \"messages-tuple\": SubgraphMessagesTupleStreamEvent;\n events: SubgraphEventsStreamEvent;\n tasks: SubgraphTasksStreamEvent<TStateType, TUpdateType>;\n checkpoints: SubgraphCheckpointsStreamEvent<TStateType>;\n}[TStreamMode extends StreamMode[] ? TStreamMode[number] : TStreamMode] | SubgraphErrorStreamEvent | MetadataStreamEvent | FeedbackStreamEvent;\nexport type TypedAsyncGenerator<TStreamMode extends StreamMode | StreamMode[] = [], TSubgraphs extends boolean = false, TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = AsyncGenerator<TSubgraphs extends true ? GetSubgraphsStreamModeMap<TStreamMode, TStateType, TUpdateType, TCustomType> : GetStreamModeMap<TStreamMode, TStateType, TUpdateType, TCustomType>>;\nexport {};\n"],"mappings":";;;;;;;AAaA;AACA;AAA0E;AACjD;;;;;;AAWT,KAbJK,UAAAA,GAaI,QAAA,GAAA,UAAA,GAAA,SAAA,GAAA,QAAA,GAAA,OAAA,GAAA,OAAA,GAAA,aAAA,GAAA,QAAA,GAAA,gBAAA;AAKJK,KAjBAJ,gBAAAA,GAiBiB,WAGnBK,GAAS,WAAA,GAAA,cAAA;AAGnB,KAtBKJ,oBAAAA,GAsBOK;EAAyB,IAAA,EAAA,MAAA,EAAA;MAA2CD,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;;KAlB3EH,UAkB8CA,CAAAA,eAAAA;EAAU,EAAA,CAAA,EAAA,MAAA;EAIjDK,KAAAA,EAAAA,MAAAA;EAAwB,IAAA,EAAA,OAAA;;KAECN,EAnB5BE,MAmB4BF,CAAAA,IAAAA,CAAAA;EAAoB,KAAA,EAlB9CE,MAkB8C,CAAA,OAAA,CAAA,GAAA,GAlBzBA,MAkByB,CAAA,OAAA,CAAA,IAAA,MAAA,EAAA;EAG7CK,IAAAA,EApBFL,MAoBEK,CAAAA,MAAAA,CAAAA;CAAgC;;;;AAIhCC,KAnBAL,iBAmBmB,CAAA,SAAA,CAAA,GAAA;EAWnBM,EAAAA,CAAAA,EAAAA,MAAAA;EASAC,KA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0BsB;SAC3BR;YACGF;oBACQrB;UACV0B;SACDT,yBAAyBY,YAAYC;eAC/BX,+BAA+BU;EAC9CG,oBAAoBzC,eAAeyC,sBAAsBA,eAAe7B,2BAA2BF,sBAAsB0B;KAC/GO,wCAAwC3C,aAAaA,2FAA2FsC,qCAAqCO,eAAeD,0BAA0BF,0BAA0BD,aAAaH,YAAYC,aAAaC,eAAeH,iBAAiBI,aAAaH,YAAYC,aAAaC"}
1
+ {"version":3,"file":"types.stream.d.cts","names":["Message","Interrupt","Metadata","Config","ThreadTask","StreamMode","ThreadStreamMode","MessageTupleMetadata","AsSubgraph","TEvent","ValuesStreamEvent","StateType","SubgraphValuesStreamEvent","MessagesTupleStreamEvent","SubgraphMessagesTupleStreamEvent","MetadataStreamEvent","ErrorStreamEvent","SubgraphErrorStreamEvent","UpdatesStreamEvent","UpdateType","SubgraphUpdatesStreamEvent","CustomStreamEvent","T","SubgraphCustomStreamEvent","MessagesMetadataStreamEvent","MessagesCompleteStreamEvent","MessagesPartialStreamEvent","TasksStreamCreateEvent","TasksStreamResultEvent","TasksStreamErrorEvent","TasksStreamEvent","SubgraphTasksStreamEvent","CheckpointsStreamEvent","SubgraphCheckpointsStreamEvent","MessagesStreamEvent","SubgraphMessagesStreamEvent","DebugStreamEvent","SubgraphDebugStreamEvent","EventsStreamEvent","Record","SubgraphEventsStreamEvent","FeedbackStreamEvent","GetStreamModeMap","TStateType","TUpdateType","TCustomType","TStreamMode","GetSubgraphsStreamModeMap","TypedAsyncGenerator","TSubgraphs","AsyncGenerator"],"sources":["../src/types.stream.d.ts"],"sourcesContent":["import type { Message } from \"./types.messages.js\";\nimport type { Interrupt, Metadata, Config, ThreadTask } from \"./schema.js\";\n/**\nimport type { SubgraphCheckpointsStreamEvent } from \"./types.stream.subgraph.js\";\n * Stream modes\n * - \"values\": Stream only the state values.\n * - \"messages\": Stream complete messages.\n * - \"messages-tuple\": Stream (message chunk, metadata) tuples.\n * - \"updates\": Stream updates to the state.\n * - \"events\": Stream events occurring during execution.\n * - \"debug\": Stream detailed debug information.\n * - \"custom\": Stream custom events.\n */\nexport type StreamMode = \"values\" | \"messages\" | \"updates\" | \"events\" | \"debug\" | \"tasks\" | \"checkpoints\" | \"custom\" | \"messages-tuple\";\nexport type ThreadStreamMode = \"run_modes\" | \"lifecycle\" | \"state_update\";\ntype MessageTupleMetadata = {\n tags: string[];\n [key: string]: unknown;\n};\ntype AsSubgraph<TEvent extends {\n id?: string;\n event: string;\n data: unknown;\n}> = {\n id?: TEvent[\"id\"];\n event: TEvent[\"event\"] | `${TEvent[\"event\"]}|${string}`;\n data: TEvent[\"data\"];\n};\n/**\n * Stream event with values after completion of each step.\n */\nexport type ValuesStreamEvent<StateType> = {\n id?: string;\n event: \"values\";\n data: StateType;\n};\n/** @internal */\nexport type SubgraphValuesStreamEvent<StateType> = AsSubgraph<ValuesStreamEvent<StateType>>;\n/**\n * Stream event with message chunks coming from LLM invocations inside nodes.\n */\nexport type MessagesTupleStreamEvent = {\n event: \"messages\";\n data: [message: Message, config: MessageTupleMetadata];\n};\n/** @internal */\nexport type SubgraphMessagesTupleStreamEvent = AsSubgraph<MessagesTupleStreamEvent>;\n/**\n * Metadata stream event with information about the run and thread\n */\nexport type MetadataStreamEvent = {\n id?: string;\n event: \"metadata\";\n data: {\n run_id: string;\n thread_id: string;\n };\n};\n/**\n * Stream event with error information.\n */\nexport type ErrorStreamEvent = {\n id?: string;\n event: \"error\";\n data: {\n error: string;\n message: string;\n };\n};\n/** @internal */\nexport type SubgraphErrorStreamEvent = AsSubgraph<ErrorStreamEvent>;\n/**\n * Stream event with updates to the state after each step.\n * The streamed outputs include the name of the node that\n * produced the update as well as the update.\n */\nexport type UpdatesStreamEvent<UpdateType> = {\n id?: string;\n event: \"updates\";\n data: {\n [node: string]: UpdateType;\n };\n};\n/** @internal */\nexport type SubgraphUpdatesStreamEvent<UpdateType> = AsSubgraph<UpdatesStreamEvent<UpdateType>>;\n/**\n * Streaming custom data from inside the nodes.\n */\nexport type CustomStreamEvent<T> = {\n event: \"custom\";\n data: T;\n};\n/** @internal */\nexport type SubgraphCustomStreamEvent<T> = AsSubgraph<CustomStreamEvent<T>>;\ntype MessagesMetadataStreamEvent = {\n id?: string;\n event: \"messages/metadata\";\n data: {\n [messageId: string]: {\n metadata: unknown;\n };\n };\n};\ntype MessagesCompleteStreamEvent = {\n id?: string;\n event: \"messages/complete\";\n data: Message[];\n};\ntype MessagesPartialStreamEvent = {\n id?: string;\n event: \"messages/partial\";\n data: Message[];\n};\ntype TasksStreamCreateEvent<StateType> = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n input: StateType;\n triggers: string[];\n };\n};\ntype TasksStreamResultEvent<UpdateType> = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n result: [string, UpdateType][];\n };\n};\ntype TasksStreamErrorEvent = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n error: string;\n };\n};\nexport type TasksStreamEvent<StateType, UpdateType> = TasksStreamCreateEvent<StateType> | TasksStreamResultEvent<UpdateType> | TasksStreamErrorEvent;\ntype SubgraphTasksStreamEvent<StateType, UpdateType> = AsSubgraph<TasksStreamCreateEvent<StateType>> | AsSubgraph<TasksStreamResultEvent<UpdateType>> | AsSubgraph<TasksStreamErrorEvent>;\nexport type CheckpointsStreamEvent<StateType> = {\n id?: string;\n event: \"checkpoints\";\n data: {\n values: StateType;\n next: string[];\n config: Config;\n metadata: Metadata;\n tasks: ThreadTask[];\n };\n};\ntype SubgraphCheckpointsStreamEvent<StateType> = AsSubgraph<CheckpointsStreamEvent<StateType>>;\n/**\n * Message stream event specific to LangGraph Server.\n * @deprecated Use `streamMode: \"messages-tuple\"` instead.\n */\nexport type MessagesStreamEvent = MessagesMetadataStreamEvent | MessagesCompleteStreamEvent | MessagesPartialStreamEvent;\n/** @internal */\nexport type SubgraphMessagesStreamEvent = AsSubgraph<MessagesMetadataStreamEvent> | AsSubgraph<MessagesCompleteStreamEvent> | AsSubgraph<MessagesPartialStreamEvent>;\n/**\n * Stream event with detailed debug information.\n */\nexport type DebugStreamEvent = {\n id?: string;\n event: \"debug\";\n data: unknown;\n};\n/** @internal */\nexport type SubgraphDebugStreamEvent = AsSubgraph<DebugStreamEvent>;\n/**\n * Stream event with events occurring during execution.\n */\nexport type EventsStreamEvent = {\n id?: string;\n event: \"events\";\n data: {\n event: `on_${\"chat_model\" | \"llm\" | \"chain\" | \"tool\" | \"retriever\" | \"prompt\"}_${\"start\" | \"stream\" | \"end\"}` | (string & {});\n name: string;\n tags: string[];\n run_id: string;\n metadata: Record<string, unknown>;\n parent_ids: string[];\n data: unknown;\n };\n};\n/** @internal */\nexport type SubgraphEventsStreamEvent = AsSubgraph<EventsStreamEvent>;\n/**\n * Stream event with a feedback key to signed URL map. Set `feedbackKeys` in\n * the `RunsStreamPayload` to receive this event.\n */\nexport type FeedbackStreamEvent = {\n id?: string;\n event: \"feedback\";\n data: {\n [feedbackKey: string]: string;\n };\n};\ntype GetStreamModeMap<TStreamMode extends StreamMode | StreamMode[], TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = {\n values: ValuesStreamEvent<TStateType>;\n updates: UpdatesStreamEvent<TUpdateType>;\n custom: CustomStreamEvent<TCustomType>;\n debug: DebugStreamEvent;\n messages: MessagesStreamEvent;\n \"messages-tuple\": MessagesTupleStreamEvent;\n tasks: TasksStreamEvent<TStateType, TUpdateType>;\n checkpoints: CheckpointsStreamEvent<TStateType>;\n events: EventsStreamEvent;\n}[TStreamMode extends StreamMode[] ? TStreamMode[number] : TStreamMode] | ErrorStreamEvent | MetadataStreamEvent | FeedbackStreamEvent;\ntype GetSubgraphsStreamModeMap<TStreamMode extends StreamMode | StreamMode[], TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = {\n values: SubgraphValuesStreamEvent<TStateType>;\n updates: SubgraphUpdatesStreamEvent<TUpdateType>;\n custom: SubgraphCustomStreamEvent<TCustomType>;\n debug: SubgraphDebugStreamEvent;\n messages: SubgraphMessagesStreamEvent;\n \"messages-tuple\": SubgraphMessagesTupleStreamEvent;\n events: SubgraphEventsStreamEvent;\n tasks: SubgraphTasksStreamEvent<TStateType, TUpdateType>;\n checkpoints: SubgraphCheckpointsStreamEvent<TStateType>;\n}[TStreamMode extends StreamMode[] ? TStreamMode[number] : TStreamMode] | SubgraphErrorStreamEvent | MetadataStreamEvent | FeedbackStreamEvent;\nexport type TypedAsyncGenerator<TStreamMode extends StreamMode | StreamMode[] = [], TSubgraphs extends boolean = false, TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = AsyncGenerator<TSubgraphs extends true ? GetSubgraphsStreamModeMap<TStreamMode, TStateType, TUpdateType, TCustomType> : GetStreamModeMap<TStreamMode, TStateType, TUpdateType, TCustomType>>;\nexport {};\n"],"mappings":";;;;;;;AAaA;AACA;AAA0E;AACjD;;;;;;AAWT,KAbJK,UAAAA,GAaI,QAAA,GAAA,UAAA,GAAA,SAAA,GAAA,QAAA,GAAA,OAAA,GAAA,OAAA,GAAA,aAAA,GAAA,QAAA,GAAA,gBAAA;AAKJK,KAjBAJ,gBAAAA,GAiBiB,WAGnBK,GAAAA,WAAS,GAAA,cAAA;AAGnB,KAtBKJ,oBAAAA,GAsBOK;EAAyB,IAAA,EAAA,MAAA,EAAA;MAA2CD,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;;KAlB3EH,UAkB8CA,CAAAA,eAAAA;EAAU,EAAA,CAAA,EAAA,MAAA;EAIjDK,KAAAA,EAAAA,MAAAA;EAAwB,IAAA,EAAA,OAAA;;KAECN,EAnB5BE,MAmB4BF,CAAAA,IAAAA,CAAAA;EAAoB,KAAA,EAlB9CE,MAkB8C,CAAA,OAAA,CAAA,GAAA,GAlBzBA,MAkByB,CAAA,OAAA,CAAA,IAAA,MAAA,EAAA;EAG7CK,IAAAA,EApBFL,MAoBEK,CAAAA,MAAAA,CAAAA;CAAgC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sBAAsB0B;KAC9GM,8CAA8C1C,aAAaA,kDAAkDsC;UACtG/B,0BAA0B+B;WACzBvB,2BAA2BwB;UAC5BrB,0BAA0BsB;SAC3BR;YACGF;oBACQrB;UACV0B;SACDT,yBAAyBY,YAAYC;eAC/BX,+BAA+BU;EAC9CG,oBAAoBzC,eAAeyC,sBAAsBA,eAAe7B,2BAA2BF,sBAAsB0B;KAC/GO,wCAAwC3C,aAAaA,2FAA2FsC,qCAAqCO,eAAeD,0BAA0BF,0BAA0BD,aAAaH,YAAYC,aAAaC,eAAeH,iBAAiBI,aAAaH,YAAYC,aAAaC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.stream.d.ts","names":["Message","Interrupt","Metadata","Config","ThreadTask","StreamMode","ThreadStreamMode","MessageTupleMetadata","AsSubgraph","TEvent","ValuesStreamEvent","StateType","SubgraphValuesStreamEvent","MessagesTupleStreamEvent","SubgraphMessagesTupleStreamEvent","MetadataStreamEvent","ErrorStreamEvent","SubgraphErrorStreamEvent","UpdatesStreamEvent","UpdateType","SubgraphUpdatesStreamEvent","CustomStreamEvent","T","SubgraphCustomStreamEvent","MessagesMetadataStreamEvent","MessagesCompleteStreamEvent","MessagesPartialStreamEvent","TasksStreamCreateEvent","TasksStreamResultEvent","TasksStreamErrorEvent","TasksStreamEvent","SubgraphTasksStreamEvent","CheckpointsStreamEvent","SubgraphCheckpointsStreamEvent","MessagesStreamEvent","SubgraphMessagesStreamEvent","DebugStreamEvent","SubgraphDebugStreamEvent","EventsStreamEvent","Record","SubgraphEventsStreamEvent","FeedbackStreamEvent","GetStreamModeMap","TStateType","TUpdateType","TCustomType","TStreamMode","GetSubgraphsStreamModeMap","TypedAsyncGenerator","TSubgraphs","AsyncGenerator"],"sources":["../src/types.stream.d.ts"],"sourcesContent":["import type { Message } from \"./types.messages.js\";\nimport type { Interrupt, Metadata, Config, ThreadTask } from \"./schema.js\";\n/**\nimport type { SubgraphCheckpointsStreamEvent } from \"./types.stream.subgraph.js\";\n * Stream modes\n * - \"values\": Stream only the state values.\n * - \"messages\": Stream complete messages.\n * - \"messages-tuple\": Stream (message chunk, metadata) tuples.\n * - \"updates\": Stream updates to the state.\n * - \"events\": Stream events occurring during execution.\n * - \"debug\": Stream detailed debug information.\n * - \"custom\": Stream custom events.\n */\nexport type StreamMode = \"values\" | \"messages\" | \"updates\" | \"events\" | \"debug\" | \"tasks\" | \"checkpoints\" | \"custom\" | \"messages-tuple\";\nexport type ThreadStreamMode = \"run_modes\" | \"lifecycle\" | \"state_update\";\ntype MessageTupleMetadata = {\n tags: string[];\n [key: string]: unknown;\n};\ntype AsSubgraph<TEvent extends {\n id?: string;\n event: string;\n data: unknown;\n}> = {\n id?: TEvent[\"id\"];\n event: TEvent[\"event\"] | `${TEvent[\"event\"]}|${string}`;\n data: TEvent[\"data\"];\n};\n/**\n * Stream event with values after completion of each step.\n */\nexport type ValuesStreamEvent<StateType> = {\n id?: string;\n event: \"values\";\n data: StateType;\n};\n/** @internal */\nexport type SubgraphValuesStreamEvent<StateType> = AsSubgraph<ValuesStreamEvent<StateType>>;\n/**\n * Stream event with message chunks coming from LLM invocations inside nodes.\n */\nexport type MessagesTupleStreamEvent = {\n event: \"messages\";\n data: [message: Message, config: MessageTupleMetadata];\n};\n/** @internal */\nexport type SubgraphMessagesTupleStreamEvent = AsSubgraph<MessagesTupleStreamEvent>;\n/**\n * Metadata stream event with information about the run and thread\n */\nexport type MetadataStreamEvent = {\n id?: string;\n event: \"metadata\";\n data: {\n run_id: string;\n thread_id: string;\n };\n};\n/**\n * Stream event with error information.\n */\nexport type ErrorStreamEvent = {\n id?: string;\n event: \"error\";\n data: {\n error: string;\n message: string;\n };\n};\n/** @internal */\nexport type SubgraphErrorStreamEvent = AsSubgraph<ErrorStreamEvent>;\n/**\n * Stream event with updates to the state after each step.\n * The streamed outputs include the name of the node that\n * produced the update as well as the update.\n */\nexport type UpdatesStreamEvent<UpdateType> = {\n id?: string;\n event: \"updates\";\n data: {\n [node: string]: UpdateType;\n };\n};\n/** @internal */\nexport type SubgraphUpdatesStreamEvent<UpdateType> = AsSubgraph<UpdatesStreamEvent<UpdateType>>;\n/**\n * Streaming custom data from inside the nodes.\n */\nexport type CustomStreamEvent<T> = {\n event: \"custom\";\n data: T;\n};\n/** @internal */\nexport type SubgraphCustomStreamEvent<T> = AsSubgraph<CustomStreamEvent<T>>;\ntype MessagesMetadataStreamEvent = {\n id?: string;\n event: \"messages/metadata\";\n data: {\n [messageId: string]: {\n metadata: unknown;\n };\n };\n};\ntype MessagesCompleteStreamEvent = {\n id?: string;\n event: \"messages/complete\";\n data: Message[];\n};\ntype MessagesPartialStreamEvent = {\n id?: string;\n event: \"messages/partial\";\n data: Message[];\n};\ntype TasksStreamCreateEvent<StateType> = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n input: StateType;\n triggers: string[];\n };\n};\ntype TasksStreamResultEvent<UpdateType> = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n result: [string, UpdateType][];\n };\n};\ntype TasksStreamErrorEvent = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n error: string;\n };\n};\nexport type TasksStreamEvent<StateType, UpdateType> = TasksStreamCreateEvent<StateType> | TasksStreamResultEvent<UpdateType> | TasksStreamErrorEvent;\ntype SubgraphTasksStreamEvent<StateType, UpdateType> = AsSubgraph<TasksStreamCreateEvent<StateType>> | AsSubgraph<TasksStreamResultEvent<UpdateType>> | AsSubgraph<TasksStreamErrorEvent>;\nexport type CheckpointsStreamEvent<StateType> = {\n id?: string;\n event: \"checkpoints\";\n data: {\n values: StateType;\n next: string[];\n config: Config;\n metadata: Metadata;\n tasks: ThreadTask[];\n };\n};\ntype SubgraphCheckpointsStreamEvent<StateType> = AsSubgraph<CheckpointsStreamEvent<StateType>>;\n/**\n * Message stream event specific to LangGraph Server.\n * @deprecated Use `streamMode: \"messages-tuple\"` instead.\n */\nexport type MessagesStreamEvent = MessagesMetadataStreamEvent | MessagesCompleteStreamEvent | MessagesPartialStreamEvent;\n/** @internal */\nexport type SubgraphMessagesStreamEvent = AsSubgraph<MessagesMetadataStreamEvent> | AsSubgraph<MessagesCompleteStreamEvent> | AsSubgraph<MessagesPartialStreamEvent>;\n/**\n * Stream event with detailed debug information.\n */\nexport type DebugStreamEvent = {\n id?: string;\n event: \"debug\";\n data: unknown;\n};\n/** @internal */\nexport type SubgraphDebugStreamEvent = AsSubgraph<DebugStreamEvent>;\n/**\n * Stream event with events occurring during execution.\n */\nexport type EventsStreamEvent = {\n id?: string;\n event: \"events\";\n data: {\n event: `on_${\"chat_model\" | \"llm\" | \"chain\" | \"tool\" | \"retriever\" | \"prompt\"}_${\"start\" | \"stream\" | \"end\"}` | (string & {});\n name: string;\n tags: string[];\n run_id: string;\n metadata: Record<string, unknown>;\n parent_ids: string[];\n data: unknown;\n };\n};\n/** @internal */\nexport type SubgraphEventsStreamEvent = AsSubgraph<EventsStreamEvent>;\n/**\n * Stream event with a feedback key to signed URL map. Set `feedbackKeys` in\n * the `RunsStreamPayload` to receive this event.\n */\nexport type FeedbackStreamEvent = {\n id?: string;\n event: \"feedback\";\n data: {\n [feedbackKey: string]: string;\n };\n};\ntype GetStreamModeMap<TStreamMode extends StreamMode | StreamMode[], TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = {\n values: ValuesStreamEvent<TStateType>;\n updates: UpdatesStreamEvent<TUpdateType>;\n custom: CustomStreamEvent<TCustomType>;\n debug: DebugStreamEvent;\n messages: MessagesStreamEvent;\n \"messages-tuple\": MessagesTupleStreamEvent;\n tasks: TasksStreamEvent<TStateType, TUpdateType>;\n checkpoints: CheckpointsStreamEvent<TStateType>;\n events: EventsStreamEvent;\n}[TStreamMode extends StreamMode[] ? TStreamMode[number] : TStreamMode] | ErrorStreamEvent | MetadataStreamEvent | FeedbackStreamEvent;\ntype GetSubgraphsStreamModeMap<TStreamMode extends StreamMode | StreamMode[], TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = {\n values: SubgraphValuesStreamEvent<TStateType>;\n updates: SubgraphUpdatesStreamEvent<TUpdateType>;\n custom: SubgraphCustomStreamEvent<TCustomType>;\n debug: SubgraphDebugStreamEvent;\n messages: SubgraphMessagesStreamEvent;\n \"messages-tuple\": SubgraphMessagesTupleStreamEvent;\n events: SubgraphEventsStreamEvent;\n tasks: SubgraphTasksStreamEvent<TStateType, TUpdateType>;\n checkpoints: SubgraphCheckpointsStreamEvent<TStateType>;\n}[TStreamMode extends StreamMode[] ? TStreamMode[number] : TStreamMode] | SubgraphErrorStreamEvent | MetadataStreamEvent | FeedbackStreamEvent;\nexport type TypedAsyncGenerator<TStreamMode extends StreamMode | StreamMode[] = [], TSubgraphs extends boolean = false, TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = AsyncGenerator<TSubgraphs extends true ? GetSubgraphsStreamModeMap<TStreamMode, TStateType, TUpdateType, TCustomType> : GetStreamModeMap<TStreamMode, TStateType, TUpdateType, TCustomType>>;\nexport {};\n"],"mappings":";;;;;;;AAaA;AACA;AAA0E;AACjD;;;;;;AAWT,KAbJK,UAAAA,GAaI,QAAA,GAAA,UAAA,GAAA,SAAA,GAAA,QAAA,GAAA,OAAA,GAAA,OAAA,GAAA,aAAA,GAAA,QAAA,GAAA,gBAAA;AAKJK,KAjBAJ,gBAAAA,GAiBiB,WAGnBK,GAAS,WAAA,GAAA,cAAA;AAGnB,KAtBKJ,oBAAAA,GAsBOK;EAAyB,IAAA,EAAA,MAAA,EAAA;MAA2CD,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;;KAlB3EH,UAkB8CA,CAAAA,eAAAA;EAAU,EAAA,CAAA,EAAA,MAAA;EAIjDK,KAAAA,EAAAA,MAAAA;EAAwB,IAAA,EAAA,OAAA;;KAECN,EAnB5BE,MAmB4BF,CAAAA,IAAAA,CAAAA;EAAoB,KAAA,EAlB9CE,MAkB8C,CAAA,OAAA,CAAA,GAAA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oBACQrB;SACXiB,iBAAiBa,YAAYC;eACvBZ,uBAAuBW;UAC5BL;EACVQ,oBAAoBzC,eAAeyC,sBAAsBA,eAAe9B,mBAAmBD,sBAAsB0B;KAC9GM,8CAA8C1C,aAAaA,kDAAkDsC;UACtG/B,0BAA0B+B;WACzBvB,2BAA2BwB;UAC5BrB,0BAA0BsB;SAC3BR;YACGF;oBACQrB;UACV0B;SACDT,yBAAyBY,YAAYC;eAC/BX,+BAA+BU;EAC9CG,oBAAoBzC,eAAeyC,sBAAsBA,eAAe7B,2BAA2BF,sBAAsB0B;KAC/GO,wCAAwC3C,aAAaA,2FAA2FsC,qCAAqCO,eAAeD,0BAA0BF,0BAA0BD,aAAaH,YAAYC,aAAaC,eAAeH,iBAAiBI,aAAaH,YAAYC,aAAaC"}
1
+ {"version":3,"file":"types.stream.d.ts","names":["Message","Interrupt","Metadata","Config","ThreadTask","StreamMode","ThreadStreamMode","MessageTupleMetadata","AsSubgraph","TEvent","ValuesStreamEvent","StateType","SubgraphValuesStreamEvent","MessagesTupleStreamEvent","SubgraphMessagesTupleStreamEvent","MetadataStreamEvent","ErrorStreamEvent","SubgraphErrorStreamEvent","UpdatesStreamEvent","UpdateType","SubgraphUpdatesStreamEvent","CustomStreamEvent","T","SubgraphCustomStreamEvent","MessagesMetadataStreamEvent","MessagesCompleteStreamEvent","MessagesPartialStreamEvent","TasksStreamCreateEvent","TasksStreamResultEvent","TasksStreamErrorEvent","TasksStreamEvent","SubgraphTasksStreamEvent","CheckpointsStreamEvent","SubgraphCheckpointsStreamEvent","MessagesStreamEvent","SubgraphMessagesStreamEvent","DebugStreamEvent","SubgraphDebugStreamEvent","EventsStreamEvent","Record","SubgraphEventsStreamEvent","FeedbackStreamEvent","GetStreamModeMap","TStateType","TUpdateType","TCustomType","TStreamMode","GetSubgraphsStreamModeMap","TypedAsyncGenerator","TSubgraphs","AsyncGenerator"],"sources":["../src/types.stream.d.ts"],"sourcesContent":["import type { Message } from \"./types.messages.js\";\nimport type { Interrupt, Metadata, Config, ThreadTask } from \"./schema.js\";\n/**\nimport type { SubgraphCheckpointsStreamEvent } from \"./types.stream.subgraph.js\";\n * Stream modes\n * - \"values\": Stream only the state values.\n * - \"messages\": Stream complete messages.\n * - \"messages-tuple\": Stream (message chunk, metadata) tuples.\n * - \"updates\": Stream updates to the state.\n * - \"events\": Stream events occurring during execution.\n * - \"debug\": Stream detailed debug information.\n * - \"custom\": Stream custom events.\n */\nexport type StreamMode = \"values\" | \"messages\" | \"updates\" | \"events\" | \"debug\" | \"tasks\" | \"checkpoints\" | \"custom\" | \"messages-tuple\";\nexport type ThreadStreamMode = \"run_modes\" | \"lifecycle\" | \"state_update\";\ntype MessageTupleMetadata = {\n tags: string[];\n [key: string]: unknown;\n};\ntype AsSubgraph<TEvent extends {\n id?: string;\n event: string;\n data: unknown;\n}> = {\n id?: TEvent[\"id\"];\n event: TEvent[\"event\"] | `${TEvent[\"event\"]}|${string}`;\n data: TEvent[\"data\"];\n};\n/**\n * Stream event with values after completion of each step.\n */\nexport type ValuesStreamEvent<StateType> = {\n id?: string;\n event: \"values\";\n data: StateType;\n};\n/** @internal */\nexport type SubgraphValuesStreamEvent<StateType> = AsSubgraph<ValuesStreamEvent<StateType>>;\n/**\n * Stream event with message chunks coming from LLM invocations inside nodes.\n */\nexport type MessagesTupleStreamEvent = {\n event: \"messages\";\n data: [message: Message, config: MessageTupleMetadata];\n};\n/** @internal */\nexport type SubgraphMessagesTupleStreamEvent = AsSubgraph<MessagesTupleStreamEvent>;\n/**\n * Metadata stream event with information about the run and thread\n */\nexport type MetadataStreamEvent = {\n id?: string;\n event: \"metadata\";\n data: {\n run_id: string;\n thread_id: string;\n };\n};\n/**\n * Stream event with error information.\n */\nexport type ErrorStreamEvent = {\n id?: string;\n event: \"error\";\n data: {\n error: string;\n message: string;\n };\n};\n/** @internal */\nexport type SubgraphErrorStreamEvent = AsSubgraph<ErrorStreamEvent>;\n/**\n * Stream event with updates to the state after each step.\n * The streamed outputs include the name of the node that\n * produced the update as well as the update.\n */\nexport type UpdatesStreamEvent<UpdateType> = {\n id?: string;\n event: \"updates\";\n data: {\n [node: string]: UpdateType;\n };\n};\n/** @internal */\nexport type SubgraphUpdatesStreamEvent<UpdateType> = AsSubgraph<UpdatesStreamEvent<UpdateType>>;\n/**\n * Streaming custom data from inside the nodes.\n */\nexport type CustomStreamEvent<T> = {\n event: \"custom\";\n data: T;\n};\n/** @internal */\nexport type SubgraphCustomStreamEvent<T> = AsSubgraph<CustomStreamEvent<T>>;\ntype MessagesMetadataStreamEvent = {\n id?: string;\n event: \"messages/metadata\";\n data: {\n [messageId: string]: {\n metadata: unknown;\n };\n };\n};\ntype MessagesCompleteStreamEvent = {\n id?: string;\n event: \"messages/complete\";\n data: Message[];\n};\ntype MessagesPartialStreamEvent = {\n id?: string;\n event: \"messages/partial\";\n data: Message[];\n};\ntype TasksStreamCreateEvent<StateType> = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n input: StateType;\n triggers: string[];\n };\n};\ntype TasksStreamResultEvent<UpdateType> = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n result: [string, UpdateType][];\n };\n};\ntype TasksStreamErrorEvent = {\n id?: string;\n event: \"tasks\";\n data: {\n id: string;\n name: string;\n interrupts: Interrupt[];\n error: string;\n };\n};\nexport type TasksStreamEvent<StateType, UpdateType> = TasksStreamCreateEvent<StateType> | TasksStreamResultEvent<UpdateType> | TasksStreamErrorEvent;\ntype SubgraphTasksStreamEvent<StateType, UpdateType> = AsSubgraph<TasksStreamCreateEvent<StateType>> | AsSubgraph<TasksStreamResultEvent<UpdateType>> | AsSubgraph<TasksStreamErrorEvent>;\nexport type CheckpointsStreamEvent<StateType> = {\n id?: string;\n event: \"checkpoints\";\n data: {\n values: StateType;\n next: string[];\n config: Config;\n metadata: Metadata;\n tasks: ThreadTask[];\n };\n};\ntype SubgraphCheckpointsStreamEvent<StateType> = AsSubgraph<CheckpointsStreamEvent<StateType>>;\n/**\n * Message stream event specific to LangGraph Server.\n * @deprecated Use `streamMode: \"messages-tuple\"` instead.\n */\nexport type MessagesStreamEvent = MessagesMetadataStreamEvent | MessagesCompleteStreamEvent | MessagesPartialStreamEvent;\n/** @internal */\nexport type SubgraphMessagesStreamEvent = AsSubgraph<MessagesMetadataStreamEvent> | AsSubgraph<MessagesCompleteStreamEvent> | AsSubgraph<MessagesPartialStreamEvent>;\n/**\n * Stream event with detailed debug information.\n */\nexport type DebugStreamEvent = {\n id?: string;\n event: \"debug\";\n data: unknown;\n};\n/** @internal */\nexport type SubgraphDebugStreamEvent = AsSubgraph<DebugStreamEvent>;\n/**\n * Stream event with events occurring during execution.\n */\nexport type EventsStreamEvent = {\n id?: string;\n event: \"events\";\n data: {\n event: `on_${\"chat_model\" | \"llm\" | \"chain\" | \"tool\" | \"retriever\" | \"prompt\"}_${\"start\" | \"stream\" | \"end\"}` | (string & {});\n name: string;\n tags: string[];\n run_id: string;\n metadata: Record<string, unknown>;\n parent_ids: string[];\n data: unknown;\n };\n};\n/** @internal */\nexport type SubgraphEventsStreamEvent = AsSubgraph<EventsStreamEvent>;\n/**\n * Stream event with a feedback key to signed URL map. Set `feedbackKeys` in\n * the `RunsStreamPayload` to receive this event.\n */\nexport type FeedbackStreamEvent = {\n id?: string;\n event: \"feedback\";\n data: {\n [feedbackKey: string]: string;\n };\n};\ntype GetStreamModeMap<TStreamMode extends StreamMode | StreamMode[], TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = {\n values: ValuesStreamEvent<TStateType>;\n updates: UpdatesStreamEvent<TUpdateType>;\n custom: CustomStreamEvent<TCustomType>;\n debug: DebugStreamEvent;\n messages: MessagesStreamEvent;\n \"messages-tuple\": MessagesTupleStreamEvent;\n tasks: TasksStreamEvent<TStateType, TUpdateType>;\n checkpoints: CheckpointsStreamEvent<TStateType>;\n events: EventsStreamEvent;\n}[TStreamMode extends StreamMode[] ? TStreamMode[number] : TStreamMode] | ErrorStreamEvent | MetadataStreamEvent | FeedbackStreamEvent;\ntype GetSubgraphsStreamModeMap<TStreamMode extends StreamMode | StreamMode[], TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = {\n values: SubgraphValuesStreamEvent<TStateType>;\n updates: SubgraphUpdatesStreamEvent<TUpdateType>;\n custom: SubgraphCustomStreamEvent<TCustomType>;\n debug: SubgraphDebugStreamEvent;\n messages: SubgraphMessagesStreamEvent;\n \"messages-tuple\": SubgraphMessagesTupleStreamEvent;\n events: SubgraphEventsStreamEvent;\n tasks: SubgraphTasksStreamEvent<TStateType, TUpdateType>;\n checkpoints: SubgraphCheckpointsStreamEvent<TStateType>;\n}[TStreamMode extends StreamMode[] ? TStreamMode[number] : TStreamMode] | SubgraphErrorStreamEvent | MetadataStreamEvent | FeedbackStreamEvent;\nexport type TypedAsyncGenerator<TStreamMode extends StreamMode | StreamMode[] = [], TSubgraphs extends boolean = false, TStateType = unknown, TUpdateType = TStateType, TCustomType = unknown> = AsyncGenerator<TSubgraphs extends true ? GetSubgraphsStreamModeMap<TStreamMode, TStateType, TUpdateType, TCustomType> : GetStreamModeMap<TStreamMode, TStateType, TUpdateType, TCustomType>>;\nexport {};\n"],"mappings":";;;;;;;AAaA;AACA;AAA0E;AACjD;;;;;;AAWT,KAbJK,UAAAA,GAaI,QAAA,GAAA,UAAA,GAAA,SAAA,GAAA,QAAA,GAAA,OAAA,GAAA,OAAA,GAAA,aAAA,GAAA,QAAA,GAAA,gBAAA;AAKJK,KAjBAJ,gBAAAA,GAiBiB,WAGnBK,GAAAA,WAAS,GAAA,cAAA;AAGnB,KAtBKJ,oBAAAA,GAsBOK;EAAyB,IAAA,EAAA,MAAA,EAAA;MAA2CD,EAAAA,MAAAA,CAAAA,EAAAA,OAAAA;;KAlB3EH,UAkB8CA,CAAAA,eAAAA;EAAU,EAAA,CAAA,EAAA,MAAA;EAIjDK,KAAAA,EAAAA,MAAAA;EAAwB,IAAA,EAAA,OAAA;;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qCAAqCrC,aAAaA,kDAAkDsC;UAC7FjC,kBAAkBiC;WACjBzB,mBAAmB0B;UACpBvB,kBAAkBwB;SACnBT;YACGF;oBACQrB;SACXiB,iBAAiBa,YAAYC;eACvBZ,uBAAuBW;UAC5BL;EACVQ,oBAAoBzC,eAAeyC,sBAAsBA,eAAe9B,mBAAmBD,sBAAsB0B;KAC9GM,8CAA8C1C,aAAaA,kDAAkDsC;UACtG/B,0BAA0B+B;WACzBvB,2BAA2BwB;UAC5BrB,0BAA0BsB;SAC3BR;YACGF;oBACQrB;UACV0B;SACDT,yBAAyBY,YAAYC;eAC/BX,+BAA+BU;EAC9CG,oBAAoBzC,eAAeyC,sBAAsBA,eAAe7B,2BAA2BF,sBAAsB0B;KAC/GO,wCAAwC3C,aAAaA,2FAA2FsC,qCAAqCO,eAAeD,0BAA0BF,0BAA0BD,aAAaH,YAAYC,aAAaC,eAAeH,iBAAiBI,aAAaH,YAAYC,aAAaC"}
@@ -63,9 +63,16 @@ interface BaseStream<StateType extends Record<string, unknown> = Record<string,
63
63
  messages: Message<ToolCall>[];
64
64
  /**
65
65
  * Current interrupt, if the stream is interrupted.
66
- * Used for human-in-the-loop workflows.
66
+ * Convenience alias for `interrupts[0]`.
67
+ * For workflows with multiple concurrent interrupts, use `interrupts` instead.
67
68
  */
68
69
  interrupt: Interrupt<GetInterruptType<Bag>> | undefined;
70
+ /**
71
+ * All current interrupts from the stream.
72
+ * When using Send() fan-out with per-task interrupt() calls,
73
+ * multiple interrupts may be pending simultaneously.
74
+ */
75
+ interrupts: Interrupt<GetInterruptType<Bag>>[];
69
76
  /**
70
77
  * Stops the currently running stream.
71
78
  * @returns A promise that resolves when the stream is stopped.
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.cts","names":["Client","ThreadState","Interrupt","StreamMode","StreamEvent","Message","DefaultToolCall","BagTemplate","Sequence","GetUpdateType","GetConfigurableType","GetInterruptType","MessageMetadata","SubmitOptions","BaseStream","Record","StateType","ToolCall","Bag","Promise"],"sources":["../../../src/ui/stream/base.d.ts"],"sourcesContent":["/**\n * Base stream types shared by all stream interfaces.\n *\n * This module contains the foundational types that are common to all streaming\n * scenarios: CompiledStateGraph, ReactAgent (createAgent), and DeepAgent (createDeepAgent).\n *\n * @module\n */\nimport type { Client } from \"../../client.js\";\nimport type { ThreadState, Interrupt } from \"../../schema.js\";\nimport type { StreamMode } from \"../../types.stream.js\";\nimport type { StreamEvent } from \"../../types.js\";\nimport type { Message, DefaultToolCall } from \"../../types.messages.js\";\nimport type { BagTemplate } from \"../../types.template.js\";\nimport type { Sequence } from \"../branching.js\";\nimport type { GetUpdateType, GetConfigurableType, GetInterruptType, MessageMetadata, SubmitOptions } from \"../types.js\";\n/**\n * Base stream interface shared by all stream types.\n *\n * Contains core properties for state management, messaging, and stream control\n * that are common to CompiledStateGraph, ReactAgent, and DeepAgent streams.\n *\n * This interface provides the foundation that all stream types build upon:\n * - State management (`values`, `isLoading`, `error`)\n * - Message handling (`messages`)\n * - Interrupt handling (`interrupt`)\n * - Stream lifecycle (`submit`, `stop`)\n * - Branching and history (`branch`, `history`)\n *\n * @template StateType - The state type of the stream\n * @template ToolCall - The tool call type for messages (inferred from agent tools)\n * @template Bag - Type configuration bag for interrupts, configurable, updates, etc.\n *\n * @example\n * ```typescript\n * // BaseStream is not used directly - use one of the specialized interfaces:\n * // - UseGraphStream for CompiledStateGraph\n * // - UseAgentStream for ReactAgent (createAgent)\n * // - UseDeepAgentStream for DeepAgent (createDeepAgent)\n * ```\n */\nexport interface BaseStream<StateType extends Record<string, unknown> = Record<string, unknown>, ToolCall = DefaultToolCall, Bag extends BagTemplate = BagTemplate> {\n /**\n * The current state values of the stream.\n * Updated as streaming events are received.\n */\n values: StateType;\n /**\n * Last seen error from the stream, if any.\n * Reset to `undefined` when a new stream starts.\n */\n error: unknown;\n /**\n * Whether the stream is currently running.\n * `true` while streaming, `false` when idle or completed.\n */\n isLoading: boolean;\n /**\n * Whether the thread is currently being loaded.\n * `true` during initial thread data fetch.\n */\n isThreadLoading: boolean;\n /**\n * Messages accumulated during the stream.\n * Includes both human and AI messages.\n * AI messages include typed tool calls based on the agent's tools.\n */\n messages: Message<ToolCall>[];\n /**\n * Current interrupt, if the stream is interrupted.\n * Used for human-in-the-loop workflows.\n */\n interrupt: Interrupt<GetInterruptType<Bag>> | undefined;\n /**\n * Stops the currently running stream.\n * @returns A promise that resolves when the stream is stopped.\n */\n stop: () => Promise<void>;\n /**\n * Create and stream a run to the thread.\n *\n * @param values - The input values to send, or null/undefined for empty input\n * @param options - Optional configuration for the submission\n * @returns A promise that resolves when the stream completes\n */\n submit: (values: GetUpdateType<Bag, StateType> | null | undefined, options?: SubmitOptions<StateType, GetConfigurableType<Bag>>) => Promise<void>;\n /**\n * The current branch of the thread.\n * Used for navigating between different conversation branches.\n */\n branch: string;\n /**\n * Set the branch of the thread.\n * @param branch - The branch identifier to switch to\n */\n setBranch: (branch: string) => void;\n /**\n * Flattened history of thread states of a thread.\n * Contains all states in the current branch's history.\n */\n history: ThreadState<StateType>[];\n /**\n * Tree of all branches for the thread.\n * @experimental This API is experimental and subject to change.\n */\n experimental_branchTree: Sequence<StateType>;\n /**\n * Get the metadata for a message, such as first thread state the message\n * was seen in and branch information.\n *\n * @param message - The message to get the metadata for\n * @param index - The index of the message in the thread\n * @returns The metadata for the message, or undefined if not found\n */\n getMessagesMetadata: (message: Message<ToolCall>, index?: number) => MessageMetadata<StateType> | undefined;\n /**\n * LangGraph SDK client used to send requests and receive responses.\n */\n client: Client;\n /**\n * The ID of the assistant to use.\n */\n assistantId: string;\n /**\n * Join an active stream that's already running.\n *\n * @param runId - The ID of the run to join\n * @param lastEventId - Optional last event ID for resuming from a specific point\n * @param options - Optional configuration for the stream\n */\n joinStream: (runId: string, lastEventId?: string, options?: {\n streamMode?: StreamMode | StreamMode[];\n filter?: (event: {\n id?: string;\n event: StreamEvent;\n data: unknown;\n }) => boolean;\n }) => Promise<void>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmIqBG,UA1FJW,UA0FIX,CAAAA,kBA1FyBY,MA0FzBZ,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,GA1FmDY,MA0FnDZ,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,EAAAA,WA1FuFG,eA0FvFH,EAAAA,YA1FoHI,WA0FpHJ,GA1FkII,WA0FlIJ,CAAAA,CAAAA;;;;;UArFTa;;;;;;;;;;;;;;;;;;;;;YAqBEX,QAAQY;;;;;aAKPf,UAAUS,iBAAiBO;;;;;cAK1BC;;;;;;;;mBAQKV,cAAcS,KAAKF,yCAAyCH,cAAcG,WAAWN,oBAAoBQ,UAAUC;;;;;;;;;;;;;;;WAe3HlB,YAAYe;;;;;2BAKIR,SAASQ;;;;;;;;;iCASHX,QAAQY,8BAA8BL,gBAAgBI;;;;UAI7EhB;;;;;;;;;;;;;iBAaSG,aAAaA;;;aAGfC;;;QAGTe"}
1
+ {"version":3,"file":"base.d.cts","names":["Client","ThreadState","Interrupt","StreamMode","StreamEvent","Message","DefaultToolCall","BagTemplate","Sequence","GetUpdateType","GetConfigurableType","GetInterruptType","MessageMetadata","SubmitOptions","BaseStream","Record","StateType","ToolCall","Bag","Promise"],"sources":["../../../src/ui/stream/base.d.ts"],"sourcesContent":["/**\n * Base stream types shared by all stream interfaces.\n *\n * This module contains the foundational types that are common to all streaming\n * scenarios: CompiledStateGraph, ReactAgent (createAgent), and DeepAgent (createDeepAgent).\n *\n * @module\n */\nimport type { Client } from \"../../client.js\";\nimport type { ThreadState, Interrupt } from \"../../schema.js\";\nimport type { StreamMode } from \"../../types.stream.js\";\nimport type { StreamEvent } from \"../../types.js\";\nimport type { Message, DefaultToolCall } from \"../../types.messages.js\";\nimport type { BagTemplate } from \"../../types.template.js\";\nimport type { Sequence } from \"../branching.js\";\nimport type { GetUpdateType, GetConfigurableType, GetInterruptType, MessageMetadata, SubmitOptions } from \"../types.js\";\n/**\n * Base stream interface shared by all stream types.\n *\n * Contains core properties for state management, messaging, and stream control\n * that are common to CompiledStateGraph, ReactAgent, and DeepAgent streams.\n *\n * This interface provides the foundation that all stream types build upon:\n * - State management (`values`, `isLoading`, `error`)\n * - Message handling (`messages`)\n * - Interrupt handling (`interrupt`)\n * - Stream lifecycle (`submit`, `stop`)\n * - Branching and history (`branch`, `history`)\n *\n * @template StateType - The state type of the stream\n * @template ToolCall - The tool call type for messages (inferred from agent tools)\n * @template Bag - Type configuration bag for interrupts, configurable, updates, etc.\n *\n * @example\n * ```typescript\n * // BaseStream is not used directly - use one of the specialized interfaces:\n * // - UseGraphStream for CompiledStateGraph\n * // - UseAgentStream for ReactAgent (createAgent)\n * // - UseDeepAgentStream for DeepAgent (createDeepAgent)\n * ```\n */\nexport interface BaseStream<StateType extends Record<string, unknown> = Record<string, unknown>, ToolCall = DefaultToolCall, Bag extends BagTemplate = BagTemplate> {\n /**\n * The current state values of the stream.\n * Updated as streaming events are received.\n */\n values: StateType;\n /**\n * Last seen error from the stream, if any.\n * Reset to `undefined` when a new stream starts.\n */\n error: unknown;\n /**\n * Whether the stream is currently running.\n * `true` while streaming, `false` when idle or completed.\n */\n isLoading: boolean;\n /**\n * Whether the thread is currently being loaded.\n * `true` during initial thread data fetch.\n */\n isThreadLoading: boolean;\n /**\n * Messages accumulated during the stream.\n * Includes both human and AI messages.\n * AI messages include typed tool calls based on the agent's tools.\n */\n messages: Message<ToolCall>[];\n /**\n * Current interrupt, if the stream is interrupted.\n * Convenience alias for `interrupts[0]`.\n * For workflows with multiple concurrent interrupts, use `interrupts` instead.\n */\n interrupt: Interrupt<GetInterruptType<Bag>> | undefined;\n /**\n * All current interrupts from the stream.\n * When using Send() fan-out with per-task interrupt() calls,\n * multiple interrupts may be pending simultaneously.\n */\n interrupts: Interrupt<GetInterruptType<Bag>>[];\n /**\n * Stops the currently running stream.\n * @returns A promise that resolves when the stream is stopped.\n */\n stop: () => Promise<void>;\n /**\n * Create and stream a run to the thread.\n *\n * @param values - The input values to send, or null/undefined for empty input\n * @param options - Optional configuration for the submission\n * @returns A promise that resolves when the stream completes\n */\n submit: (values: GetUpdateType<Bag, StateType> | null | undefined, options?: SubmitOptions<StateType, GetConfigurableType<Bag>>) => Promise<void>;\n /**\n * The current branch of the thread.\n * Used for navigating between different conversation branches.\n */\n branch: string;\n /**\n * Set the branch of the thread.\n * @param branch - The branch identifier to switch to\n */\n setBranch: (branch: string) => void;\n /**\n * Flattened history of thread states of a thread.\n * Contains all states in the current branch's history.\n */\n history: ThreadState<StateType>[];\n /**\n * Tree of all branches for the thread.\n * @experimental This API is experimental and subject to change.\n */\n experimental_branchTree: Sequence<StateType>;\n /**\n * Get the metadata for a message, such as first thread state the message\n * was seen in and branch information.\n *\n * @param message - The message to get the metadata for\n * @param index - The index of the message in the thread\n * @returns The metadata for the message, or undefined if not found\n */\n getMessagesMetadata: (message: Message<ToolCall>, index?: number) => MessageMetadata<StateType> | undefined;\n /**\n * LangGraph SDK client used to send requests and receive responses.\n */\n client: Client;\n /**\n * The ID of the assistant to use.\n */\n assistantId: string;\n /**\n * Join an active stream that's already running.\n *\n * @param runId - The ID of the run to join\n * @param lastEventId - Optional last event ID for resuming from a specific point\n * @param options - Optional configuration for the stream\n */\n joinStream: (runId: string, lastEventId?: string, options?: {\n streamMode?: StreamMode | StreamMode[];\n filter?: (event: {\n id?: string;\n event: StreamEvent;\n data: unknown;\n }) => boolean;\n }) => Promise<void>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyHyFgB,UAhFxEF,UAgFwEE,CAAAA,kBAhF3CD,MAgF2CC,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,GAhFjBD,MAgFiBC,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,EAAAA,WAhFmBV,eAgFnBU,EAAAA,YAhFgDT,WAgFhDS,GAhF8DT,WAgF9DS,CAAAA,CAAAA;;;;;QAoBtEZ,EA/FPY,SA+FOZ;;;;;;;;;;;;;;;;;;;;;YA1ELC,QAAQY;;;;;;aAMPf,UAAUS,iBAAiBO;;;;;;cAM1BhB,UAAUS,iBAAiBO;;;;;cAK3BC;;;;;;;;mBAQKV,cAAcS,KAAKF,yCAAyCH,cAAcG,WAAWN,oBAAoBQ,UAAUC;;;;;;;;;;;;;;;WAe3HlB,YAAYe;;;;;2BAKIR,SAASQ;;;;;;;;;iCASHX,QAAQY,8BAA8BL,gBAAgBI;;;;UAI7EhB;;;;;;;;;;;;;iBAaSG,aAAaA;;;aAGfC;;;QAGTe"}
@@ -63,9 +63,16 @@ interface BaseStream<StateType extends Record<string, unknown> = Record<string,
63
63
  messages: Message<ToolCall>[];
64
64
  /**
65
65
  * Current interrupt, if the stream is interrupted.
66
- * Used for human-in-the-loop workflows.
66
+ * Convenience alias for `interrupts[0]`.
67
+ * For workflows with multiple concurrent interrupts, use `interrupts` instead.
67
68
  */
68
69
  interrupt: Interrupt<GetInterruptType<Bag>> | undefined;
70
+ /**
71
+ * All current interrupts from the stream.
72
+ * When using Send() fan-out with per-task interrupt() calls,
73
+ * multiple interrupts may be pending simultaneously.
74
+ */
75
+ interrupts: Interrupt<GetInterruptType<Bag>>[];
69
76
  /**
70
77
  * Stops the currently running stream.
71
78
  * @returns A promise that resolves when the stream is stopped.
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","names":["Client","ThreadState","Interrupt","StreamMode","StreamEvent","Message","DefaultToolCall","BagTemplate","Sequence","GetUpdateType","GetConfigurableType","GetInterruptType","MessageMetadata","SubmitOptions","BaseStream","Record","StateType","ToolCall","Bag","Promise"],"sources":["../../../src/ui/stream/base.d.ts"],"sourcesContent":["/**\n * Base stream types shared by all stream interfaces.\n *\n * This module contains the foundational types that are common to all streaming\n * scenarios: CompiledStateGraph, ReactAgent (createAgent), and DeepAgent (createDeepAgent).\n *\n * @module\n */\nimport type { Client } from \"../../client.js\";\nimport type { ThreadState, Interrupt } from \"../../schema.js\";\nimport type { StreamMode } from \"../../types.stream.js\";\nimport type { StreamEvent } from \"../../types.js\";\nimport type { Message, DefaultToolCall } from \"../../types.messages.js\";\nimport type { BagTemplate } from \"../../types.template.js\";\nimport type { Sequence } from \"../branching.js\";\nimport type { GetUpdateType, GetConfigurableType, GetInterruptType, MessageMetadata, SubmitOptions } from \"../types.js\";\n/**\n * Base stream interface shared by all stream types.\n *\n * Contains core properties for state management, messaging, and stream control\n * that are common to CompiledStateGraph, ReactAgent, and DeepAgent streams.\n *\n * This interface provides the foundation that all stream types build upon:\n * - State management (`values`, `isLoading`, `error`)\n * - Message handling (`messages`)\n * - Interrupt handling (`interrupt`)\n * - Stream lifecycle (`submit`, `stop`)\n * - Branching and history (`branch`, `history`)\n *\n * @template StateType - The state type of the stream\n * @template ToolCall - The tool call type for messages (inferred from agent tools)\n * @template Bag - Type configuration bag for interrupts, configurable, updates, etc.\n *\n * @example\n * ```typescript\n * // BaseStream is not used directly - use one of the specialized interfaces:\n * // - UseGraphStream for CompiledStateGraph\n * // - UseAgentStream for ReactAgent (createAgent)\n * // - UseDeepAgentStream for DeepAgent (createDeepAgent)\n * ```\n */\nexport interface BaseStream<StateType extends Record<string, unknown> = Record<string, unknown>, ToolCall = DefaultToolCall, Bag extends BagTemplate = BagTemplate> {\n /**\n * The current state values of the stream.\n * Updated as streaming events are received.\n */\n values: StateType;\n /**\n * Last seen error from the stream, if any.\n * Reset to `undefined` when a new stream starts.\n */\n error: unknown;\n /**\n * Whether the stream is currently running.\n * `true` while streaming, `false` when idle or completed.\n */\n isLoading: boolean;\n /**\n * Whether the thread is currently being loaded.\n * `true` during initial thread data fetch.\n */\n isThreadLoading: boolean;\n /**\n * Messages accumulated during the stream.\n * Includes both human and AI messages.\n * AI messages include typed tool calls based on the agent's tools.\n */\n messages: Message<ToolCall>[];\n /**\n * Current interrupt, if the stream is interrupted.\n * Used for human-in-the-loop workflows.\n */\n interrupt: Interrupt<GetInterruptType<Bag>> | undefined;\n /**\n * Stops the currently running stream.\n * @returns A promise that resolves when the stream is stopped.\n */\n stop: () => Promise<void>;\n /**\n * Create and stream a run to the thread.\n *\n * @param values - The input values to send, or null/undefined for empty input\n * @param options - Optional configuration for the submission\n * @returns A promise that resolves when the stream completes\n */\n submit: (values: GetUpdateType<Bag, StateType> | null | undefined, options?: SubmitOptions<StateType, GetConfigurableType<Bag>>) => Promise<void>;\n /**\n * The current branch of the thread.\n * Used for navigating between different conversation branches.\n */\n branch: string;\n /**\n * Set the branch of the thread.\n * @param branch - The branch identifier to switch to\n */\n setBranch: (branch: string) => void;\n /**\n * Flattened history of thread states of a thread.\n * Contains all states in the current branch's history.\n */\n history: ThreadState<StateType>[];\n /**\n * Tree of all branches for the thread.\n * @experimental This API is experimental and subject to change.\n */\n experimental_branchTree: Sequence<StateType>;\n /**\n * Get the metadata for a message, such as first thread state the message\n * was seen in and branch information.\n *\n * @param message - The message to get the metadata for\n * @param index - The index of the message in the thread\n * @returns The metadata for the message, or undefined if not found\n */\n getMessagesMetadata: (message: Message<ToolCall>, index?: number) => MessageMetadata<StateType> | undefined;\n /**\n * LangGraph SDK client used to send requests and receive responses.\n */\n client: Client;\n /**\n * The ID of the assistant to use.\n */\n assistantId: string;\n /**\n * Join an active stream that's already running.\n *\n * @param runId - The ID of the run to join\n * @param lastEventId - Optional last event ID for resuming from a specific point\n * @param options - Optional configuration for the stream\n */\n joinStream: (runId: string, lastEventId?: string, options?: {\n streamMode?: StreamMode | StreamMode[];\n filter?: (event: {\n id?: string;\n event: StreamEvent;\n data: unknown;\n }) => boolean;\n }) => Promise<void>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmIqBG,UA1FJW,UA0FIX,CAAAA,kBA1FyBY,MA0FzBZ,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,GA1FmDY,MA0FnDZ,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,EAAAA,WA1FuFG,eA0FvFH,EAAAA,YA1FoHI,WA0FpHJ,GA1FkII,WA0FlIJ,CAAAA,CAAAA;;;;;UArFTa;;;;;;;;;;;;;;;;;;;;;YAqBEX,QAAQY;;;;;aAKPf,UAAUS,iBAAiBO;;;;;cAK1BC;;;;;;;;mBAQKV,cAAcS,KAAKF,yCAAyCH,cAAcG,WAAWN,oBAAoBQ,UAAUC;;;;;;;;;;;;;;;WAe3HlB,YAAYe;;;;;2BAKIR,SAASQ;;;;;;;;;iCASHX,QAAQY,8BAA8BL,gBAAgBI;;;;UAI7EhB;;;;;;;;;;;;;iBAaSG,aAAaA;;;aAGfC;;;QAGTe"}
1
+ {"version":3,"file":"base.d.ts","names":["Client","ThreadState","Interrupt","StreamMode","StreamEvent","Message","DefaultToolCall","BagTemplate","Sequence","GetUpdateType","GetConfigurableType","GetInterruptType","MessageMetadata","SubmitOptions","BaseStream","Record","StateType","ToolCall","Bag","Promise"],"sources":["../../../src/ui/stream/base.d.ts"],"sourcesContent":["/**\n * Base stream types shared by all stream interfaces.\n *\n * This module contains the foundational types that are common to all streaming\n * scenarios: CompiledStateGraph, ReactAgent (createAgent), and DeepAgent (createDeepAgent).\n *\n * @module\n */\nimport type { Client } from \"../../client.js\";\nimport type { ThreadState, Interrupt } from \"../../schema.js\";\nimport type { StreamMode } from \"../../types.stream.js\";\nimport type { StreamEvent } from \"../../types.js\";\nimport type { Message, DefaultToolCall } from \"../../types.messages.js\";\nimport type { BagTemplate } from \"../../types.template.js\";\nimport type { Sequence } from \"../branching.js\";\nimport type { GetUpdateType, GetConfigurableType, GetInterruptType, MessageMetadata, SubmitOptions } from \"../types.js\";\n/**\n * Base stream interface shared by all stream types.\n *\n * Contains core properties for state management, messaging, and stream control\n * that are common to CompiledStateGraph, ReactAgent, and DeepAgent streams.\n *\n * This interface provides the foundation that all stream types build upon:\n * - State management (`values`, `isLoading`, `error`)\n * - Message handling (`messages`)\n * - Interrupt handling (`interrupt`)\n * - Stream lifecycle (`submit`, `stop`)\n * - Branching and history (`branch`, `history`)\n *\n * @template StateType - The state type of the stream\n * @template ToolCall - The tool call type for messages (inferred from agent tools)\n * @template Bag - Type configuration bag for interrupts, configurable, updates, etc.\n *\n * @example\n * ```typescript\n * // BaseStream is not used directly - use one of the specialized interfaces:\n * // - UseGraphStream for CompiledStateGraph\n * // - UseAgentStream for ReactAgent (createAgent)\n * // - UseDeepAgentStream for DeepAgent (createDeepAgent)\n * ```\n */\nexport interface BaseStream<StateType extends Record<string, unknown> = Record<string, unknown>, ToolCall = DefaultToolCall, Bag extends BagTemplate = BagTemplate> {\n /**\n * The current state values of the stream.\n * Updated as streaming events are received.\n */\n values: StateType;\n /**\n * Last seen error from the stream, if any.\n * Reset to `undefined` when a new stream starts.\n */\n error: unknown;\n /**\n * Whether the stream is currently running.\n * `true` while streaming, `false` when idle or completed.\n */\n isLoading: boolean;\n /**\n * Whether the thread is currently being loaded.\n * `true` during initial thread data fetch.\n */\n isThreadLoading: boolean;\n /**\n * Messages accumulated during the stream.\n * Includes both human and AI messages.\n * AI messages include typed tool calls based on the agent's tools.\n */\n messages: Message<ToolCall>[];\n /**\n * Current interrupt, if the stream is interrupted.\n * Convenience alias for `interrupts[0]`.\n * For workflows with multiple concurrent interrupts, use `interrupts` instead.\n */\n interrupt: Interrupt<GetInterruptType<Bag>> | undefined;\n /**\n * All current interrupts from the stream.\n * When using Send() fan-out with per-task interrupt() calls,\n * multiple interrupts may be pending simultaneously.\n */\n interrupts: Interrupt<GetInterruptType<Bag>>[];\n /**\n * Stops the currently running stream.\n * @returns A promise that resolves when the stream is stopped.\n */\n stop: () => Promise<void>;\n /**\n * Create and stream a run to the thread.\n *\n * @param values - The input values to send, or null/undefined for empty input\n * @param options - Optional configuration for the submission\n * @returns A promise that resolves when the stream completes\n */\n submit: (values: GetUpdateType<Bag, StateType> | null | undefined, options?: SubmitOptions<StateType, GetConfigurableType<Bag>>) => Promise<void>;\n /**\n * The current branch of the thread.\n * Used for navigating between different conversation branches.\n */\n branch: string;\n /**\n * Set the branch of the thread.\n * @param branch - The branch identifier to switch to\n */\n setBranch: (branch: string) => void;\n /**\n * Flattened history of thread states of a thread.\n * Contains all states in the current branch's history.\n */\n history: ThreadState<StateType>[];\n /**\n * Tree of all branches for the thread.\n * @experimental This API is experimental and subject to change.\n */\n experimental_branchTree: Sequence<StateType>;\n /**\n * Get the metadata for a message, such as first thread state the message\n * was seen in and branch information.\n *\n * @param message - The message to get the metadata for\n * @param index - The index of the message in the thread\n * @returns The metadata for the message, or undefined if not found\n */\n getMessagesMetadata: (message: Message<ToolCall>, index?: number) => MessageMetadata<StateType> | undefined;\n /**\n * LangGraph SDK client used to send requests and receive responses.\n */\n client: Client;\n /**\n * The ID of the assistant to use.\n */\n assistantId: string;\n /**\n * Join an active stream that's already running.\n *\n * @param runId - The ID of the run to join\n * @param lastEventId - Optional last event ID for resuming from a specific point\n * @param options - Optional configuration for the stream\n */\n joinStream: (runId: string, lastEventId?: string, options?: {\n streamMode?: StreamMode | StreamMode[];\n filter?: (event: {\n id?: string;\n event: StreamEvent;\n data: unknown;\n }) => boolean;\n }) => Promise<void>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyHyFgB,UAhFxEF,UAgFwEE,CAAAA,kBAhF3CD,MAgF2CC,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,GAhFjBD,MAgFiBC,CAAAA,MAAAA,EAAAA,OAAAA,CAAAA,EAAAA,WAhFmBV,eAgFnBU,EAAAA,YAhFgDT,WAgFhDS,GAhF8DT,WAgF9DS,CAAAA,CAAAA;;;;;QAoBtEZ,EA/FPY,SA+FOZ;;;;;;;;;;;;;;;;;;;;;YA1ELC,QAAQY;;;;;;aAMPf,UAAUS,iBAAiBO;;;;;;cAM1BhB,UAAUS,iBAAiBO;;;;;cAK3BC;;;;;;;;mBAQKV,cAAcS,KAAKF,yCAAyCH,cAAcG,WAAWN,oBAAoBQ,UAAUC;;;;;;;;;;;;;;;WAe3HlB,YAAYe;;;;;2BAKIR,SAASQ;;;;;;;;;iCASHX,QAAQY,8BAA8BL,gBAAgBI;;;;UAI7EhB;;;;;;;;;;;;;iBAaSG,aAAaA;;;aAGfC;;;QAGTe"}
@@ -128,6 +128,7 @@ var SubagentManager = class {
128
128
  return allToolCalls.filter((tc) => tc.aiMessage.id === message.id);
129
129
  },
130
130
  interrupt: void 0,
131
+ interrupts: [],
131
132
  subagents: /* @__PURE__ */ new Map(),
132
133
  activeSubagents: [],
133
134
  getSubagent: () => void 0,