import type { DeliverableMode } from './deliverable-contract.js';
import type { ProjectMapSnapshot } from './protocol/project-map-types.js';
export declare const RUN_WORKSPACE_DIR = ".owlcoda-run";
export declare const RUN_WORKSPACE_STRUCTURE_VERSION = 2;
export declare const RUN_WORKSPACE_DIRECTORIES: readonly ["stage", "final", "assets", "scripts", "evidence", "notes"];
export type RunWorkspaceDirectory = typeof RUN_WORKSPACE_DIRECTORIES[number];
export type TaskFamily = 'deck' | 'code' | 'image_asset' | 'research' | 'data_report' | 'release' | 'general';
export type RunArtifactOrigin = 'write' | 'edit' | 'bash_detected' | 'skill_asset_copy' | 'manual' | (string & {});
export type RunArtifactStatus = 'present' | 'missing';
export interface RunWorkspacePaths {
    outputRoot: string;
    runDir: string;
    manifestPath: string;
    checkpointPath: string;
    skillRoutePath: string;
    planPath: string;
    artifactsPath: string;
    verificationPath: string;
    projectMapPath: string;
    eventsPath: string;
    stageDir: string;
    finalDir: string;
    assetsDir: string;
    scriptsDir: string;
    evidenceDir: string;
    notesDir: string;
}
export interface RunManifest {
    version: 1;
    structureVersion: typeof RUN_WORKSPACE_STRUCTURE_VERSION;
    runId: string;
    createdAt: string;
    outputRoot: string;
    cwd: string;
    createdDirectories: RunWorkspaceDirectory[];
    taskFamily?: TaskFamily;
    deliverableMode?: DeliverableMode;
}
export interface RunArtifactRecord {
    id: string;
    path: string;
    origin: RunArtifactOrigin;
    size: number | null;
    mtime: string | null;
    mtimeMs: number | null;
    stepId?: string;
    participatesInFinal: boolean;
    status: RunArtifactStatus;
    sourcePath?: string;
    recordedAt: string;
    updatedAt: string;
    missingAt?: string;
}
export interface ArtifactLedger {
    version: 1;
    updatedAt: string;
    artifacts: RunArtifactRecord[];
}
export interface RunWorkspaceEvent {
    type: string;
    at?: string;
    stepId?: string;
    message?: string;
    data?: Record<string, unknown>;
}
export interface StoredRunWorkspaceEvent extends RunWorkspaceEvent {
    at: string;
    runId: string;
}
export interface CreateRunWorkspaceOptions {
    outputRoot: string;
    cwd?: string;
    runId?: string;
    createdAt?: string;
    taskFamily?: TaskFamily;
    deliverableMode?: DeliverableMode;
    skillRoute?: Record<string, unknown>;
    plan?: Record<string, unknown>;
    verification?: Record<string, unknown>;
    projectMap?: ProjectMapSnapshot;
    checkpoint?: RunCheckpoint;
    artifacts?: RunArtifactRecord[];
}
export interface CreateRunWorkspaceResult {
    paths: RunWorkspacePaths;
    manifest: RunManifest;
}
export interface RecordArtifactOptions {
    path: string;
    origin: RunArtifactOrigin;
    stepId?: string;
    participatesInFinal?: boolean;
    sourcePath?: string;
    id?: string;
}
export interface ReadArtifactLedgerOptions {
    refresh?: boolean;
}
export type RunCheckpoint = Record<string, unknown>;
export declare function getRunWorkspacePaths(outputRoot: string, cwd?: string): RunWorkspacePaths;
export declare function createRunWorkspace(options: CreateRunWorkspaceOptions): Promise<CreateRunWorkspaceResult>;
export declare function readManifest(runRef: string, cwd?: string): Promise<RunManifest>;
export declare function writeCheckpoint(runRef: string, checkpoint: RunCheckpoint, cwd?: string): Promise<RunCheckpoint>;
export declare function readCheckpoint(runRef: string, cwd?: string): Promise<RunCheckpoint>;
export declare function writeSkillRoute(runRef: string, skillRoute: Record<string, unknown>, cwd?: string): Promise<void>;
export declare function writePlan(runRef: string, plan: Record<string, unknown>, cwd?: string): Promise<void>;
export declare function writeVerification(runRef: string, verification: Record<string, unknown>, cwd?: string): Promise<void>;
export declare function writeProjectMap(runRef: string, projectMap: ProjectMapSnapshot, cwd?: string): Promise<ProjectMapSnapshot>;
export declare function readProjectMap(runRef: string, cwd?: string): Promise<ProjectMapSnapshot>;
export declare function readArtifactLedger(runRef: string, options?: ReadArtifactLedgerOptions, cwd?: string): Promise<ArtifactLedger>;
export declare function recordArtifact(runRef: string, options: RecordArtifactOptions, cwd?: string): Promise<RunArtifactRecord>;
export declare function refreshArtifactLedger(runRef: string, cwd?: string): Promise<ArtifactLedger>;
export declare function recordEvent(runRef: string, event: RunWorkspaceEvent, cwd?: string): Promise<StoredRunWorkspaceEvent>;
export declare function getRunWorkspacePathsFromRef(runRef: string, cwd?: string): RunWorkspacePaths;
