import './instrumentation'; import { Command } from '@langchain/langgraph'; import type { MessageContentComplex, BaseMessage } from '@langchain/core/messages'; import type { RunnableConfig } from '@langchain/core/runnables'; import type * as t from '@/types'; import { MultiAgentGraph } from '@/graphs/MultiAgentGraph'; import { StandardGraph } from '@/graphs/Graph'; export declare const defaultOmitOptions: Set; export declare class Run<_T extends t.BaseGraphState> { id: string; private tokenCounter?; private handlerRegistry?; private hookRegistry?; private toolOutputRegistry?; private indexTokenCountMap?; graphRunnable?: t.CompiledStateWorkflow; Graph: StandardGraph | MultiAgentGraph | undefined; returnContent: boolean; private skipCleanup; private _originalCallbacksSnapshot?; private constructor(); private createLegacyGraph; private createMultiAgentGraph; static create(config: t.RunConfig): Promise>; getRunMessages(): BaseMessage[] | undefined; /** * Manually trigger cleanup of heavy state (messages, config, etc.). * Call this after all continuations are complete when using skipCleanup=true. */ clearState(): void; /** * Returns the normalized finish/stop reason from the last LLM invocation. * Delegates to the underlying Graph instance. */ getLastFinishReason(): string | undefined; /** * Returns the ID of the last agent that produced output in a multi-agent graph. * Used by auto-continuation to determine which agent's context to preserve * when a response is truncated after an agent handoff. * Returns undefined for single-agent graphs. */ getLastActiveAgentId(): string | undefined; /** * Creates a custom event callback handler that intercepts custom events * and processes them through our handler registry instead of EventStreamCallbackHandler */ private createCustomEventCallback; /** * Processes the graph stream for a given input. * * @param inputs - Either the initial state (IState) for a new run, or a * Command (e.g., `new Command({ resume: ... })`) to resume from an interrupt. * @param config - Runnable config with version and optional run_id. * @param streamOptions - Optional stream event callbacks and options. */ processStream(inputs: t.IState | Command, config: Partial & { version: 'v1' | 'v2'; run_id?: string; }, streamOptions?: t.EventStreamOptions): Promise; private createSystemCallback; /** * Checks whether the graph was interrupted (e.g., by HITL tool approval). * Call after processStream() returns to determine if the graph is waiting * for a resume via Command({ resume }). * * Requires a checkpointer to be configured — without one, interrupt state * is not persisted and this always returns false. */ hasInterrupts(config: Partial): Promise; /** * Returns the interrupt values from the graph state. * Each interrupt's `value` contains the data passed to `interrupt()` by the node * (e.g., a ToolApprovalRequest for HITL). */ getInterruptValues(config: Partial): Promise; getCallbacks(clientCallbacks: t.ClientCallbacks): t.SystemCallbacks; generateTitle({ provider, inputText, contentParts, titlePrompt, clientOptions, chainOptions, skipLanguage, titleMethod, titlePromptTemplate, }: t.RunTitleOptions): Promise<{ language?: string; title?: string; }>; }