/** * Event-kernel handlers for remaining phase kinds (S2 completion): * reduce, gate, approval, loop, tournament, flow. * * Intentionally does not import runtime.ts. Nested flows go through * `StepDeps.runNested` (injected by driver). */ import type { Phase, Taskflow } from "../schema.ts"; import { type UsageStats } from "../usage.ts"; import type { Event } from "./events.ts"; import type { StepContext, StepResult } from "./step.ts"; type BodyResult = { midEvents: Event[]; output?: string; status: StepResult["status"]; error?: string; usage: UsageStats; gate?: { verdict: "pass" | "block"; reason?: string; }; approval?: { decision: "approve" | "reject" | "edit"; note?: string; auto?: boolean; }; warnings?: string[]; promptStats?: StepResult["promptStats"]; }; /** Resolve the effective idle-watchdog ms for a phase on the kernel path: * phase overrides flow; `undefined` when neither sets it (host default 300000 * applies). Mirrors `resolveIdleTimeoutMs` in runtime.ts — duplicated here * because the kernel deliberately does not import runtime.ts (strangler cycle). */ export declare function resolveIdleMs(phase: Phase, def: Taskflow): number | undefined; /** Build the promptStats StepResult field for one or more resolved prompts, * appending a warning when any crosses the conservative threshold. */ export declare function buildPromptStats(prompts: string[]): { promptStats: NonNullable; warnings: string[]; }; /** reduce / agent-style single call. */ export declare function executeReduceBody(phase: Phase, ctx: StepContext): Promise; /** Gate: LLM judge + parseGateVerdict (score/eval advanced paths stay on imperative). */ export declare function executeGateBody(phase: Phase, ctx: StepContext): Promise; /** Approval: interactive or auto-reject, with optional timeoutMs / onExpire. */ export declare function executeApprovalBody(phase: Phase, ctx: StepContext): Promise; /** Loop: until / convergence / maxIterations (no reflexion — imperative for that). */ export declare function executeLoopBody(phase: Phase, ctx: StepContext): Promise; /** Tournament: N variants + judge. */ export declare function executeTournamentBody(phase: Phase, ctx: StepContext): Promise; /** Nested flow: saved `use` or inline `def` via StepDeps.runNested. */ export declare function executeFlowBody(phase: Phase, ctx: StepContext): Promise; export {}; //# sourceMappingURL=step-kinds.d.ts.map