import type { GoalControllerDecision } from "./goal-controller.js";
export type GoalRunStatus = "draft" | "blocked" | "ready" | "running" | "verifying" | "passed" | "failed" | "paused";
export type GoalTaskStatus = "pending" | "running" | "verifying" | "done" | "failed" | "blocked";
export type GoalPrerequisiteStatus = "unknown" | "met" | "missing";
export type GoalEvidenceKind = "log" | "command" | "screenshot" | "file" | "summary";
export type GoalVerificationStatus = "pass" | "fail" | "unknown";
export interface GoalVerificationResult {
    status: GoalVerificationStatus;
    summary: string;
    command?: string;
    exitCode?: number;
    outputPath?: string;
    checkedAt: string;
}
export interface GoalCompletionAudit {
    status: GoalVerificationStatus;
    summary: string;
    checkedAt: string;
    verifierCheckedAt?: string;
    outputPath?: string;
}
export interface GoalPrerequisite {
    id: string;
    label: string;
    status: GoalPrerequisiteStatus;
    checkCommand?: string;
    instructions?: string;
    evidence?: string;
}
export interface GoalHarnessItem {
    id: string;
    label: string;
    command?: string;
    path?: string;
    description?: string;
}
export type GoalEvidenceMechanism = "command" | "test" | "script" | "fixture" | "log" | "screenshot" | "video" | "browser" | "device" | "source" | "file" | "manual";
export interface GoalEvidencePlan {
    id: string;
    label: string;
    mechanism: GoalEvidenceMechanism;
    description: string;
    status: "planned" | "ready" | "blocked";
    command?: string;
    path?: string;
    instructions?: string;
    evidence?: string;
}
export interface GoalTask {
    id: string;
    title: string;
    prompt: string;
    status: GoalTaskStatus;
    workerId?: string;
    attempts: number;
    verification?: GoalVerificationResult;
    lastSummary?: string;
}
export interface GoalEvidence {
    id: string;
    kind: GoalEvidenceKind;
    label: string;
    path?: string;
    content?: string;
    createdAt: string;
}
export interface GoalVerifier {
    description: string;
    command?: string;
    lastResult?: GoalVerificationResult;
}
export interface GoalRun {
    id: string;
    title: string;
    goal: string;
    status: GoalRunStatus;
    createdAt: string;
    updatedAt: string;
    projectPath: string;
    successCriteria: string[];
    prerequisites: GoalPrerequisite[];
    harness: GoalHarnessItem[];
    evidencePlan: GoalEvidencePlan[];
    tasks: GoalTask[];
    evidence: GoalEvidence[];
    verifier?: GoalVerifier;
    completionAudit?: GoalCompletionAudit;
    blockers: string[];
    activeWorkerId?: string;
    continueRequestedAt?: string;
}
export interface GoalCounts {
    total: number;
    active: number;
    blocked: number;
    pending: number;
    running: number;
    passed: number;
    failed: number;
}
export interface ReconcileActiveGoalRunsOptions {
    isWorkerActive?: (workerId: string, run: GoalRun) => boolean;
    isVerifierActive?: (run: GoalRun) => boolean;
}
export interface GoalReconciliationResult {
    runs: GoalRun[];
    repairedRunIds: string[];
    evidenceCount: number;
}
export interface GoalRunInput {
    id?: string;
    title: string;
    goal: string;
    status?: GoalRunStatus;
    successCriteria?: string[];
    prerequisites?: GoalPrerequisite[];
    harness?: GoalHarnessItem[];
    evidencePlan?: GoalEvidencePlan[];
    tasks?: GoalTask[];
    evidence?: GoalEvidence[];
    verifier?: GoalVerifier;
    completionAudit?: GoalCompletionAudit;
    blockers?: string[];
    activeWorkerId?: string;
    continueRequestedAt?: string;
}
export interface GoalTaskInput {
    id?: string;
    title: string;
    prompt: string;
    status?: GoalTaskStatus;
    workerId?: string;
    attempts?: number;
    verification?: GoalVerificationResult;
    lastSummary?: string;
}
export interface GoalEvidenceInput {
    id?: string;
    kind: GoalEvidenceKind;
    label: string;
    path?: string;
    content?: string;
    createdAt?: string;
}
export declare function normalizeProjectPath(cwd: string): string;
export declare function dedupeGoalBlockers(blockers: readonly string[]): string[];
export declare function appendGoalBlockers(blockers: readonly string[], nextBlockers: string | readonly string[] | undefined): string[];
export declare function hashPath(cwd: string): string;
export declare function projectDir(cwd: string): string;
export declare function createGoalTask(input: GoalTaskInput): GoalTask;
export declare function createGoalEvidence(input: GoalEvidenceInput): GoalEvidence;
export declare function createGoalRun(cwd: string, input: GoalRunInput): GoalRun;
export declare function loadGoalRuns(cwd: string): Promise<GoalRun[]>;
export declare function saveGoalRuns(cwd: string, runs: readonly GoalRun[]): Promise<void>;
export declare function reconcileActiveGoalRuns(cwd: string, options?: ReconcileActiveGoalRunsOptions): Promise<GoalReconciliationResult>;
export declare function upsertGoalRun(cwd: string, input: GoalRun | GoalRunInput): Promise<GoalRun>;
export declare function getGoalRun(cwd: string, id: string): Promise<GoalRun | null>;
export declare function getActiveGoalRun(cwd: string): Promise<GoalRun | null>;
export declare function appendGoalDecision(cwd: string, runId: string, decision: GoalControllerDecision | {
    kind: string;
    reason?: string;
    content?: string;
}): Promise<GoalRun | null>;
export declare function appendGoalEvidence(cwd: string, runId: string, input: GoalEvidenceInput): Promise<GoalRun | null>;
export declare function updateGoalTask(cwd: string, runId: string, taskId: string, patch: Partial<GoalTask> | GoalTaskInput): Promise<GoalRun | null>;
export declare function isBlockingGoalPrerequisite(item: GoalPrerequisite): boolean;
export declare function hasBlockingGoalPrerequisites(prerequisites: readonly GoalPrerequisite[]): boolean;
export declare function goalHasBlockingPrerequisites(run: GoalRun): boolean;
export declare function formatGoalPrerequisiteInstruction(item: GoalPrerequisite): string;
export declare function formatGoalBlockingPrerequisiteList(prerequisites: readonly GoalPrerequisite[]): string;
export declare function formatGoalBlockingPrerequisites(run: GoalRun): string;
export declare function summarizeGoalCountsFromRuns(runs: readonly GoalRun[]): GoalCounts;
export declare function summarizeGoalCounts(cwd: string): Promise<GoalCounts>;
export declare function writeGoalProgressJournal(cwd: string, runId: string): Promise<string | null>;
//# sourceMappingURL=goal-store.d.ts.map