import type { OrchestratorConfig } from "../../core/config.js"; export interface PiWorkflowCapabilities { sendPrompt(prompt: string): void; notify(message: string, level: "info" | "warning" | "error"): void; confirm(title: string, message: string): Promise; setActiveTools(tools: readonly string[]): void; } export interface PiNodeContext { runId: string; cwd: string; config: Readonly; graphVersion: string; capabilities: PiWorkflowCapabilities; ownsRun(runId: string, expectedNode: string): boolean; persist(state: State, evidence?: Record): void; restoreIfOwner(runId: string): Promise; } export type PiNodeHandler = ( state: Readonly, context: PiNodeContext, ) => Promise<{ event: Event; output?: Output; evidence?: Record }>; export type PiNodeHandlerRegistry = ReadonlyMap>;