/**
 * OwlCoda Native Headless Runner
 *
 * Non-interactive single-shot mode: send prompt → run agentic loop → print result → exit.
 * Used by `owlcoda run --native --prompt "..."` and piped stdin.
 */
import { type OperatingMode } from './modes.js';
import type { TaskRunStatus } from './protocol/types.js';
import { evaluateProjectMapDogfoodAcceptance } from './project-map-acceptance.js';
interface HeadlessProjectMapRuntimeEvidence {
    schema_version: 1;
    enabled: boolean;
    snapshot_present: boolean;
    prompt_injected: boolean;
    freshness_status?: string;
    git_head?: string;
    package_name?: string;
    package_version?: string;
    source_files: Array<{
        path: string;
        kind: string;
        scope?: string;
    }>;
    entrypoints: Array<{
        path: string;
        kind: string;
    }>;
    write_boundaries: Array<{
        path: string;
        kind: string;
        origin?: string;
    }>;
    verification_profiles: Array<{
        id: string;
        applies_to?: string;
        commands: string[];
        required_before_done?: boolean;
    }>;
    convergence_notices: string[];
}
interface HeadlessProjectMapAcceptanceEvidence {
    schema_version: 1;
    ok: boolean;
    failures: string[];
    checks: ReturnType<typeof evaluateProjectMapDogfoodAcceptance>['checks'];
    max_iterations: number | null;
}
export interface HeadlessOptions {
    apiBaseUrl: string;
    apiKey: string;
    model: string;
    mode?: OperatingMode;
    prompt: string;
    maxTokens?: number;
    systemPrompt?: string;
    /** If true, output JSON with structured result contract */
    json?: boolean;
    /** If true, auto-approve task-contract-declared file mutations */
    autoApprove?: boolean;
    /** Optional comma/list style tool allowlist. Narrows, never widens, the base policy. */
    allowTools?: readonly string[];
    /** Optional comma/list style tool denylist. Deny wins over allow and base policy. */
    denyTools?: readonly string[];
    /** Resume an existing session by ID ('last' resolves to most recent) */
    resumeSession?: string;
    /** Whether to save the session after completion */
    saveSessionOnComplete?: boolean;
}
export interface HeadlessResult {
    text: string;
    exitCode: number;
    iterations: number;
    sessionId?: string;
    resumed?: boolean;
    runtimeRetries?: number;
    /** Approval policy that was applied to this run. */
    approvalPolicy?: string;
    approvalToolAllowlist?: string[];
    approvalToolDenylist?: string[];
    /** Tools that the policy denied (with reason); useful for callers/tests. */
    approvalDenials?: Array<{
        toolName: string;
        reason: string;
        bashRiskLevel?: string;
        bashRiskReasons?: string[];
    }>;
    /** Conversation loop stop reason, exposed so batch runners can detect incomplete work. */
    stopReason?: string | null;
    /** Final task execution status when the task contract subsystem is active. */
    taskStatus?: TaskRunStatus;
    /** Last task guard reason when the task ended blocked/drifted/waiting. */
    taskGuardReason?: string;
    /** Project Map runtime evidence emitted for JSON dogfood acceptance. */
    projectMapRuntime?: HeadlessProjectMapRuntimeEvidence;
    /** Project Map dogfood acceptance verdict emitted for JSON dogfood acceptance. */
    projectMapAcceptance?: HeadlessProjectMapAcceptanceEvidence;
}
/** Run a single-shot native conversation. */
export declare function runHeadless(opts: HeadlessOptions): Promise<HeadlessResult>;
export {};
