import { LangChainBaseMessage } from "./types.js"; import { AssembledToolCall, SubagentDiscoverySnapshot, SubgraphDiscoverySnapshot } from "@langchain/react"; //#region src/hooks.d.ts /** * Read the current LangGraph interrupt state from the runtime extras. */ declare const useLangChainInterruptState: () => { value?: unknown; } | undefined; /** * Read every interrupt pending at the current checkpoint, each with `id` * and `value`. Defaults to an empty array. Pair with `useLangChainRespondAll` * (keyed by interrupt id) to resolve several at once. */ declare const useLangChainInterrupts: () => readonly { id?: string; value?: unknown; }[]; /** Read the last run/hydration error from the runtime extras. */ declare const useLangChainError: () => unknown; /** * Read the root tool calls assembled by `useStream` from the `tools` * channel. Defaults to an empty array, so consumers can `.map` without * a guard. Useful for rendering pending/streamed tool calls and * approval UIs. */ declare const useLangChainToolCalls: () => readonly AssembledToolCall[]; /** Subagents discovered on the current run (multi-agent graphs). */ declare const useLangChainSubagents: () => ReadonlyMap; /** Subgraphs discovered on the current run. */ declare const useLangChainSubgraphs: () => ReadonlyMap; /** * The underlying `useStream` handle, for advanced views — pass it to v1's * `useMessages(stream, target)` / `useToolCalls(stream, target)` with a * subagent/subgraph from `useLangChainSubagents` / `useLangChainSubgraphs`. * `undefined` outside the runtime provider. */ declare const useLangChainStream: () => import("@langchain/react").AnyStream | undefined; /** * Returns a function to submit raw state updates to the LangGraph agent, * bypassing the normal message flow. Useful for sending interrupt resume * commands. */ declare const useLangChainSubmit: () => (values: Record | null | undefined, options?: Record) => Promise; /** * Resume a LangGraph interrupt with a response payload via * `useStream().respond`. Preferred over `useLangChainSendCommand`; it * carries the response cleanly and handles interrupt namespaces. */ declare const useLangChainRespond: () => (response: unknown, options?: Record) => Promise; /** * Resume several LangGraph interrupts pending at the same checkpoint in * one run via `useStream().respondAll`. Use when a run pauses on multiple * interrupts at once; sequential `useLangChainRespond` calls can't service * them (the first resume starts a run, stranding the rest). */ declare const useLangChainRespondAll: () => (responsesById: Record, options?: Record) => Promise; /** * Submit a list of LangChain-shaped messages on the current thread. * Parity helper for migrating from `useLangGraphSend`. Routes to * `useStream().submit({ [messagesKey]: messages }, options)`. */ declare const useLangChainSend: () => (messages: readonly LangChainBaseMessage[], options?: Record) => Promise; /** * Submit a `useStream` command (e.g. interrupt resume). Parity helper * for migrating from `useLangGraphSendCommand`. Note that v1's command * shape (`{ resume?, goto?, update? }`) differs from the legacy * `{ resume: string }` form; to carry a payload, use the input or * `stream.respond` instead. */ declare const useLangChainSendCommand: () => (command: Record) => Promise; /** * Read a custom LangGraph state key from the current thread. Mirrors * `useStream().values[key]` from `@langchain/react` and updates when the * stream emits new state. * * @example * ```tsx * const todos = useLangChainState("todos"); * const files = useLangChainState>("files", {}); * ``` */ declare function useLangChainState(key: string): T | undefined; declare function useLangChainState(key: string, defaultValue: T): T; //#endregion export { useLangChainError, useLangChainInterruptState, useLangChainInterrupts, useLangChainRespond, useLangChainRespondAll, useLangChainSend, useLangChainSendCommand, useLangChainState, useLangChainStream, useLangChainSubagents, useLangChainSubgraphs, useLangChainSubmit, useLangChainToolCalls }; //# sourceMappingURL=hooks.d.ts.map