export type ResetEntityKind = "task" | "bug"; export interface ResetPlan { role: string; phaseIndex: number; preStatus: string; } /** * Pure planner: resolve the target phase to its index + pre-status for the given * entity kind. Returns an `error` string for an unknown phase (no IO, fully * unit-testable). */ export declare function planReset(kind: ResetEntityKind, toPhase: string): ResetPlan | { error: string; }; /** Result of a status-setter call. */ export interface SetStatusResult { ok: boolean; /** Status the record held before the transition, if known. */ from?: string; /** Error detail on failure. */ detail?: string; } export interface ResetPipelineParams { /** Which pipeline's state to reset. */ kind: ResetEntityKind; cwd: string; /** Task or bug id. */ id: string; /** Target phase role (e.g. "implement", "triage"). */ toPhase: string; /** Absolute path to store-cli.cjs. */ storeCli: string; /** * Override the status-setter (tests inject a stub). Defaults to a * force-transition via store-cli with FORGE_ALLOW_FORCE=1. */ setStatus?: (status: string) => SetStatusResult; } export interface ResetPipelineResult { ok: boolean; role?: string; phaseIndex?: number; preStatus?: string; detail?: string; } /** * Force an entity's status to the target phase's pre-status and rewrite the * resume-state cache so the pipeline re-enters at that phase. Returns * `{ok:false, detail}` rather than throwing on a planning or status-set failure; * the resume-state is written ONLY after the status transition succeeds, so a * failed reset never leaves a half-rewound pipeline. */ export declare function resetPipelineState(p: ResetPipelineParams): ResetPipelineResult;