import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent"; import type { PhaseDescriptor } from "../run-task.js"; import type { BugRecord } from "./bug-id.js"; import type { RunBugPipelineResult } from "./run-bug-types.js"; export interface MaybeSkipParams { phase: PhaseDescriptor; bugId: string; cwd: string; ctx: ExtensionCommandContext; storeCli: string; /** Bug record read at the top of §6a (same read the caller already did). */ bugNow: BugRecord | null; summaryKeyByRole: Record; } /** * §6a — decide whether the current phase should be skipped because the bug is * already in a done state. When skipping, writes a synthetic summary so * downstream `after ` verdict checks succeed. Returns true when the * caller should `currentPhaseIndex++; continue;`. */ export declare function maybeSkipPhase(p: MaybeSkipParams): boolean; export interface CaptureTriageBugIdParams { bugId: string; cwd: string; ctx: ExtensionCommandContext; storeCli: string; currentPhaseIndex: number; iterationCounts: Record; debugLogDisabled: boolean; toolExecutionEvents: Array<{ toolName?: string; result?: unknown; }>; } export type CaptureTriageBugIdOutcome = { kind: "return"; result: RunBugPipelineResult; } | { kind: "ok"; bugId: string; debugLogPath: string | null; writeDebug: (rec: Record) => void; }; /** * Post-triage bugId capture: for new bugs the triage subagent creates the bug * record via store-cli; capture the real id by scanning tool_execution_end * events, with a list-and-filter fallback. On success re-initializes the debug * log under the real id and returns the updated locals. Preserves the PENDING- * nuance: the orchestrator transcript writer keeps the PENDING entityId — this * only updates the loop's local bugId. */ export declare function captureTriageBugId(p: CaptureTriageBugIdParams, writeDebug: (rec: Record) => void, debugLogPath: string | null): CaptureTriageBugIdOutcome; export interface RouteAfterTriageParams { bugId: string; cwd: string; ctx: ExtensionCommandContext; storeCli: string; currentPhaseIndex: number; } export type RouteAfterTriageOutcome = { kind: "jump"; toIndex: number; } | { kind: "advance"; }; /** * §6c — orchestrator-owned post-triage status transitions, then the Path A/B * branch read from bug.summaries.triage.route. Path A skips plan-fix + * review-plan (jumps to implement); Path B / missing / any other value advances * normally. */ export declare function routeAfterTriage(p: RouteAfterTriageParams): RouteAfterTriageOutcome;