import { type NodeName, type NodeFn, type NodeDefinition, type Edge, type ChannelSchema, type ONIConfig, type ONISkeleton, type ONICheckpointer, type RetryPolicy, type CachePolicy } from "./types.js"; import type { AgentNode } from "./agents/types.js"; import { ONIPregelRunner } from "./pregel.js"; import type { HITLSession } from "./hitl/index.js"; import type { BaseStore } from "./store/index.js"; import type { GuardrailsConfig } from "./guardrails/types.js"; import type { EventListeners } from "./events/types.js"; import type { TracerLike } from "./telemetry.js"; /** Internal interface for accessing the Pregel runner attached to a compiled skeleton. */ export interface CompiledGraphInternals> { _runner: ONIPregelRunner; } export interface ONISkeletonV3 extends ONISkeleton { /** * Resume a paused execution by providing a response to an interrupt. * The resumeId comes from the HITLInterruptException.interrupt.resumeId. */ resume(config: { threadId: string; resumeId: string; }, value: unknown): Promise; /** Get all pending interrupt sessions for a thread */ getPendingInterrupts(config: { threadId: string; }): HITLSession[]; /** Get dead letters for a thread (only available when deadLetterQueue is enabled) */ getDeadLetters?(config: { threadId: string; }): import("./dlq.js").DeadLetter[]; } export declare class StateGraph> { private nodes; private edges; private readonly channels; constructor(schema: { channels: ChannelSchema; }); /** Return the current edges array. */ getEdges(): Edge[]; /** Look up a single node definition by name. */ getNodeDef(name: string): NodeDefinition | undefined; /** Return the nodes map. Used by inspect/descriptor builders. */ getNodeMap(): ReadonlyMap>; /** Clear all edges. Used by swarm templates to rewire topology. */ clearEdges(): void; addNode(name: string, fn: NodeFn, opts?: { retry?: RetryPolicy; cache?: boolean | CachePolicy; timeout?: number; circuitBreaker?: { threshold: number; resetAfter: number; fallback?: (state: S, error: Error) => import("./types.js").NodeReturn; }; }): this; addSubgraph(name: string, subgraph: ONISkeleton, opts?: { retry?: RetryPolicy; }): this; addAgent(agentNode: AgentNode): this; addEdge(from: NodeName, to: NodeName | NodeName[]): this; addConditionalEdges(from: NodeName, condition: (state: S, config?: ONIConfig) => NodeName | NodeName[], pathMap?: Record): this; private validate; compile(options?: CompileOptions): ONISkeletonV3; toMermaid(): string; } export interface CompileOptions { checkpointer?: ONICheckpointer; interruptBefore?: string[]; interruptAfter?: string[]; store?: BaseStore; guardrails?: GuardrailsConfig; listeners?: EventListeners; defaults?: { nodeTimeout?: number; }; deadLetterQueue?: boolean; /** OTel-compatible tracer for distributed tracing. Pass any Tracer that satisfies TracerLike. */ tracer?: TracerLike; } export interface ONIMessage { role: "user" | "assistant" | "system" | "tool"; content: string; name?: string; tool_call_id?: string; tool_calls?: ONIToolCall[]; } export interface ONIToolCall { id: string; name: string; args: Record; } export type MessageState = { messages: ONIMessage[]; }; export declare class MessageGraph extends StateGraph { constructor(); } declare module "./graph.js" { interface StateGraph { getGraph(): import("./inspect.js").GraphDescriptor; toMermaidDetailed(): string; } } //# sourceMappingURL=graph.d.ts.map