import type { RawHandoff } from '../../../local/request-normalizer.js';
import type { LocalEntrypointOptions, LocalResponse } from '../../../local/entrypoint.js';
import { runLocal } from '../../../local/entrypoint.js';
export { legacyLocalRunStatePath, localRunStatePath, localRunStateRoot } from '../../../shared/state-paths.js';
export type LocalRunMode = 'background' | 'foreground';
export interface LocalRunMonitorState {
    runId: string;
    status: 'queued' | 'running' | 'completed' | 'blocked' | 'failed';
    artifactPath: string;
    artifactDir: string;
    statePath: string;
    logPath: string;
    evidencePath: string;
    fixesPath: string;
    reattachCommand: string;
    response?: LocalResponse;
}
export interface LocalRunMonitorOptions {
    cwd: string;
    artifactPath: string;
    handoff: RawHandoff;
    mode: LocalRunMode;
    autoFixAttempts?: number;
    localOptions?: LocalEntrypointOptions;
    runLocalFn?: typeof runLocal;
    onMonitorStarted?: (state: LocalRunMonitorState) => void | Promise<void>;
    /** Override where Ricky stores run reattachment state. Defaults under .workflow-artifacts/. */
    stateRoot?: string;
    /**
     * Inject a deterministic run-id factory for tests. The factory must return
     * a stable id given the artifactPath and mode so reattach paths and
     * `ricky status --run <id>` reproduce exactly across invocations.
     */
    runIdFactory?: (input: {
        artifactPath: string;
        mode: LocalRunMode;
    }) => string;
}
export declare function startLocalRunMonitor(options: LocalRunMonitorOptions): Promise<LocalRunMonitorState>;
export declare function initializeLocalRunMonitorState(options: Pick<LocalRunMonitorOptions, 'cwd' | 'artifactPath' | 'mode' | 'stateRoot' | 'runIdFactory'>): Promise<LocalRunMonitorState>;
export declare function localWorkflowArtifactDir(cwd: string, runId: string): string;
export declare function withSafeRunOptions(handoff: RawHandoff, autoFixAttempts: number | undefined, trackingRunId?: string): RawHandoff;
