import type { ReviewOutput, ReviewSummary } from "@danielblomma/cortex-core/validators/engine"; export type WorkflowPhase = "planning" | "plan_review" | "implementation_pending" | "implementation" | "iterating" | "reviewed" | "approved"; export type WorkflowPlanStatus = "missing" | "pending_review" | "changes_requested" | "approved"; export type WorkflowReviewStatus = "not_run" | "failed" | "passed"; export type WorkflowApprovalStatus = "blocked" | "ready" | "approved"; export type WorkflowBlocker = { code: "plan_missing" | "plan_not_approved" | "implementation_not_started" | "code_review_required" | "review_failed"; message: string; }; export type WorkflowPlan = { title: string | null; summary: string | null; tasks: string[]; status: WorkflowPlanStatus; updated_at: string | null; reviewed_at: string | null; review_notes: string | null; }; export type WorkflowReviewSnapshot = { status: WorkflowReviewStatus; scope: "all" | "changed" | null; reviewed_at: string | null; artifact_path: string | null; summary: ReviewSummary | null; failed_policies: string[]; warning_policies: string[]; reviewed_files: WorkflowReviewedFileSnapshot[] | null; }; export type WorkflowApproval = { status: WorkflowApprovalStatus; approved_at: string | null; notes: string | null; }; export type WorkflowNote = { id: number; title: string; details: string; created_at: string; }; export type WorkflowTodo = { id: number; title: string; details: string; status: "open" | "done"; created_at: string; updated_at: string; }; export type WorkflowHistoryEntry = { at: string; event: "plan_set" | "plan_reviewed" | "implementation_started" | "review_recorded" | "workflow_updated" | "workflow_approved" | "note_added" | "todo_added" | "todo_completed"; details?: Record; }; export type WorkflowState = { version: 1; created_at: string; updated_at: string; phase: WorkflowPhase; blocked_reasons: WorkflowBlocker[]; plan: WorkflowPlan; last_review: WorkflowReviewSnapshot; approval: WorkflowApproval; next_note_id: number; next_todo_id: number; notes: WorkflowNote[]; todos: WorkflowTodo[]; history: WorkflowHistoryEntry[]; }; export type WorkflowMutationResult = { ok: boolean; state: WorkflowState; error?: string; }; export type WorkflowReviewedFileSnapshot = { path: string; exists: boolean; hash: string | null; }; export declare function loadWorkflowState(contextDir: string): WorkflowState; export declare function setWorkflowPlan(contextDir: string, input: { title: string; summary: string; tasks?: string[]; }): WorkflowState; export declare function reviewWorkflowPlan(contextDir: string, input: { approved: boolean; notes?: string; }): WorkflowMutationResult; export declare function startWorkflowImplementation(contextDir: string): WorkflowMutationResult; export declare function recordWorkflowReview(contextDir: string, input: { scope: "all" | "changed"; output: ReviewOutput; reviewed_files?: WorkflowReviewedFileSnapshot[] | null; }): WorkflowState; export declare function recordWorkflowUpdate(contextDir: string, input: { summary: string; phase?: "implementation" | "iterating" | "plan_review"; }): WorkflowState; export declare function addWorkflowNote(contextDir: string, input: { title: string; details: string; }): WorkflowState; export declare function addWorkflowTodo(contextDir: string, input: { title: string; details?: string; }): WorkflowState; export declare function completeWorkflowTodo(contextDir: string, todoId: number): WorkflowMutationResult; export declare function approveWorkflow(contextDir: string, notes?: string): WorkflowMutationResult; //# sourceMappingURL=state.d.ts.map