/** * LangGraph integration helpers for kanban-lite. * * Provides a board-state annotation and pre-built graph nodes so that * LangGraph agents can read and mutate kanban state inside a `StateGraph`. * * @example * ```ts * import { StateGraph } from '@langchain/langgraph' * import { KanbanSDK } from 'kanban-lite/sdk' * import { KanbanBoardState, createRefreshBoardNode, createKanbanToolNode } from 'kl-adapter-langchain' * * const sdk = new KanbanSDK('/path/to/.kanban') * await sdk.init() * * const graph = new StateGraph(KanbanBoardState) * .addNode('refresh', createRefreshBoardNode(sdk)) * .addNode('tools', createKanbanToolNode(sdk)) * .addEdge('__start__', 'refresh') * .addEdge('refresh', 'tools') * .addEdge('tools', '__end__') * .compile() * ``` * * @module */ import type { KanbanSDK } from './tools/types'; /** Card summary stored inside graph state. */ export interface CardSummary { id: string; title: string; status: string; priority: string; assignee: string | null; labels: string[]; dueDate: string | null; commentCount: number; } /** Column definition stored inside graph state. */ export interface ColumnSummary { id: string; name: string; color?: string; } /** Board snapshot carried through a LangGraph state. */ export interface BoardSnapshot { boardId: string; columns: ColumnSummary[]; cards: CardSummary[]; labels: Record; lastRefreshed: string; } /** * LangGraph state annotation for kanban board workflows. * * Includes a `board` snapshot (cards, columns, labels) and a `messages` * accumulator for conversational agent patterns. * * @throws If `@langchain/langgraph` is not installed. */ export declare function getKanbanBoardState(): any; /** * Creates a LangGraph node that refreshes the board snapshot in state. * * @example * ```ts * graph.addNode('refresh', createRefreshBoardNode(sdk)) * ``` */ export declare function createRefreshBoardNode(sdk: KanbanSDK, boardId?: string): (_state: Record) => Promise<{ board: BoardSnapshot; }>; /** * Creates a LangGraph `ToolNode`-compatible function that invokes * the full kanban-lite toolkit. * * Callers should pass this to `new ToolNode(createKanbanToolkit(sdk))` or * use it as a standalone node that processes tool calls from messages. */ export declare function createKanbanToolNode(sdk: KanbanSDK): (state: { messages: any[]; }) => Promise<{ messages: unknown[]; }>;