import { type LoopEventHandler, type LoopEventName } from "./loop-events.js"; import { type LoopRunConfig, type LoopRunState, type LoopStatus } from "./loop-run.js"; import { type OpencodeRuntime, type OpencodeEventSubscription } from "./opencode-client.js"; import { type EngineTemplates } from "./templates.js"; export type LoopToastVariant = "success" | "warning" | "error" | "info"; export type LoopToastNotifier = (input: { title: string; message: string; variant: LoopToastVariant; }) => Promise; export type LoopEngineOptions = { runtime: OpencodeRuntime; templates?: EngineTemplates; /** Override OpenCode event subscription (used by tests). */ subscribeEvents?: (onEvent: (event: unknown) => void | Promise) => Promise; onToast?: LoopToastNotifier; }; /** Controls a single Ralph loop run for one supervisor session. */ export type LoopEngine = { readonly state: LoopRunState; on: (event: LoopEventName, handler: LoopEventHandler) => () => void; start: (config?: Partial) => Promise; pause: (reason?: string) => Promise; resume: () => Promise; stop: (reason?: string) => Promise; status: () => Promise; peekWorker: (maxLines?: number) => Promise; /** Process one OpenCode event (serialized through an internal queue). */ handleEvent: (event: unknown) => Promise; dispose: () => void; }; /** Create a loop engine bound to a supervisor session and worktree. */ export declare function createLoopEngine(config: LoopRunConfig, options: LoopEngineOptions): LoopEngine; export declare function createDefaultLoopEngine(config: LoopRunConfig): LoopEngine; //# sourceMappingURL=loop-engine.d.ts.map