import type { ToolMessage } from '@langchain/core/messages'; import type { Serialized } from '@langchain/core/load/serializable.js'; import { Node } from './node'; /** * Resolve a node name from serialized data, runName, or metadata. * Falls back to capitalised nodeType. */ export declare function getNodeName(nodeType: string, serialized?: Serialized | null, runName?: string, metadata?: Record): string; /** * Build a hierarchical agent name from the parent node. */ export declare function getAgentName(nodes: Record, parentRunId: string | undefined, defaultName: string): string; /** * Detect a ToolMessage inside a tool output, including LangGraph Command objects * that carry a messages array. */ export declare function findToolMessage(output: unknown): ToolMessage | null; /** * Retroactively upgrade a root-level chain node to agent type when any of its * children carry langgraph_* metadata keys. */ export declare function updateRootToAgent(parentRunId: string | undefined, metadata: Record | undefined, nodes: Record): void;