import { ThreadState } from "../schema.js"; import { Message } from "../types.messages.js"; import { StreamMode, ToolProgress } from "../types.stream.js"; import { StreamEvent } from "../types.js"; import { Client } from "../client/index.js"; import { BagTemplate } from "../types.template.js"; import { BaseSubagentState, CompiledSubAgentLike, CustomSubmitOptions, DeepAgentTypeConfigLike, DefaultSubagentStates, ExtractDeepAgentConfig, ExtractSubAgentMiddleware, GetConfigurableType, GetInterruptType, GetToolCallsType, GetUpdateType, InferDeepAgentSubagents, InferSubagentByName, InferSubagentNames, InferSubagentState, IsDeepAgentLike, MessageMetadata, RunCallbackMeta, StreamBase, SubAgentLike, SubagentStateMap, SubagentStream, SubagentStreamInterface, SubmitOptions, UseStreamCustomOptions, UseStreamOptions, UseStreamThread, UseStreamTransport } from "../ui/types.js"; import { Sequence } from "../ui/branching.js"; //#region src/react/types.d.ts interface UseStream = Record, Bag extends BagTemplate = BagTemplate, SubagentStates extends Record = DefaultSubagentStates> extends StreamBase, GetInterruptType, SubagentStates> { /** * Whether the thread is currently being loaded. */ isThreadLoading: boolean; /** * Stops the stream. */ stop: () => Promise; /** * Create and stream a run to the thread. */ submit: (values: GetUpdateType | null | undefined, options?: SubmitOptions>) => Promise; /** * The current branch of the thread. */ branch: string; /** * Set the branch of the thread. */ setBranch: (branch: string) => void; /** * Flattened history of thread states of a thread. */ history: ThreadState[]; /** * Tree of all branches for the thread. * @experimental */ experimental_branchTree: Sequence; /** * Get the metadata for a message, such as first thread state the message * was seen in and branch information. * * @param message - The message to get the metadata for. * @param index - The index of the message in the thread. * @returns The metadata for the message. */ getMessagesMetadata: (message: Message>, index?: number) => MessageMetadata | undefined; /** * Progress of tool executions during streaming. */ toolProgress: ToolProgress[]; /** * LangGraph SDK client used to send request and receive responses. */ client: Client; /** * The ID of the assistant to use. */ assistantId: string; /** * Join an active stream. */ joinStream: (runId: string, lastEventId?: string, options?: { streamMode?: StreamMode | StreamMode[]; filter?: (event: { id?: string; event: StreamEvent; data: unknown; }) => boolean; }) => Promise; } type UseStreamCustom = Record, Bag extends BagTemplate = BagTemplate, SubagentStates extends Record = DefaultSubagentStates> = Pick, "values" | "error" | "isLoading" | "stop" | "interrupt" | "interrupts" | "messages" | "toolCalls" | "getToolCalls" | "subagents" | "activeSubagents" | "getSubagent" | "getSubagentsByType" | "getSubagentsByMessage"> & { submit: (values: GetUpdateType | null | undefined, options?: CustomSubmitOptions>) => Promise; }; //#endregion export { UseStream, UseStreamCustom }; //# sourceMappingURL=types.d.ts.map