import type { PrWalkthroughAnalysisBundleMetadata } from "./walkthrough-analysis-bundle.js";
export declare const PR_WALKTHROUGH_AGENT_STORE_SCHEMA_VERSION = 1;
export type PrWalkthroughJobStatus = "starting" | "waiting_for_yaml" | "validation_failed" | "ready" | "error";
export type PrWalkthroughTarget = {
    provider: "github" | "local" | string;
    prUrl?: string;
    owner?: string;
    repo?: string;
    number?: number;
    baseSha?: string;
    headSha?: string;
    /**
     * Normalized GitHub host for github-provider targets ("github.com" for
     * github.com/www.github.com, the real host otherwise). Used to host-qualify
     * changeset ids so two enterprise hosts sharing owner/repo/number do not
     * collide on the same tabId / stored-payload path / export lookup.
     */
    host?: string;
    canonicalKey: string;
};
export type PrWalkthroughValidationIssue = {
    path: string;
    message: string;
};
export type PrWalkthroughValidationSummary = {
    code: "YAML_SCHEMA_INVALID" | string;
    message: string;
    errors: PrWalkthroughValidationIssue[];
    retryable: boolean;
    yamlHash?: string;
};
export type WalkthroughWarning = {
    code: string;
    severity: "info" | "warning" | "error";
    message: string;
    filePath?: string;
};
export type PrWalkthroughJobError = {
    code: string;
    message: string;
    retryable?: boolean;
    host?: string;
};
export interface PrWalkthroughJobRecord {
    schemaVersion: typeof PR_WALKTHROUGH_AGENT_STORE_SCHEMA_VERSION;
    jobId: string;
    parentSessionId: string;
    childSessionId: string;
    projectId?: string;
    cwd: string;
    target: PrWalkthroughTarget;
    changesetId: string;
    tabId: string;
    status: PrWalkthroughJobStatus;
    title: string;
    createdAt: string;
    updatedAt: string;
    lastValidationError?: PrWalkthroughValidationSummary;
    submittedAt?: string;
    payloadUpdatedAt?: string;
    warnings?: WalkthroughWarning[];
    error?: PrWalkthroughJobError;
    reminderCount?: number;
    submissionProofHash?: string;
    analysisBundle?: PrWalkthroughAnalysisBundleMetadata;
}
export declare function createSubmissionProof(): string;
export declare function hashSubmissionProof(jobId: string, sessionId: string, proof: string): string;
export declare function verifySubmissionProof(proof: string | undefined, job: Pick<PrWalkthroughJobRecord, "jobId" | "childSessionId" | "submissionProofHash">): boolean;
export declare function rotateSubmissionProofForRestoredJob(stateDir: string, sessionId: string, jobId: string): Record<string, string> | undefined;
export declare function walkthroughTargetEnvForJob(job: Pick<PrWalkthroughJobRecord, "target">): Record<string, string>;
export declare class WalkthroughAgentStore {
    private readonly rootDir;
    constructor(stateDir?: string);
    save(record: PrWalkthroughJobRecord): PrWalkthroughJobRecord;
    create(input: Omit<PrWalkthroughJobRecord, "schemaVersion" | "createdAt" | "updatedAt"> & {
        createdAt?: string;
        updatedAt?: string;
    }): PrWalkthroughJobRecord;
    update(jobId: string, updates: Partial<Omit<PrWalkthroughJobRecord, "schemaVersion" | "jobId" | "createdAt">>): PrWalkthroughJobRecord | null;
    get(jobId: string): PrWalkthroughJobRecord | null;
    getByChildSession(childSessionId: string): PrWalkthroughJobRecord | null;
    findByParentAndTarget(parentSessionId: string, canonicalTargetKey: string): PrWalkthroughJobRecord | null;
    list(): PrWalkthroughJobRecord[];
    private readFile;
    private ensureDir;
    private filePath;
}
export declare function sanitizeJob(record: PrWalkthroughJobRecord): PrWalkthroughJobRecord;
//# sourceMappingURL=walkthrough-agent-store.d.ts.map