import { type CommandContext, type GlobalOptions } from '../../app/command-context.js';
import { appendProjectLog } from '../project/log/append.js';
import { type ExecTarget, type OatConfig, type OatLocalConfig, type UserConfig } from '../../config/oat-config.js';
import { type ResolvedConfig } from '../../config/resolve.js';
import { type ModelFamily } from '../../providers/identity/family.js';
import { type IdentityConfidence, type IdentityProvenance } from '../../providers/identity/provenance.js';
import { Command } from 'commander';
import { createGateActivityProbe, type GateActivityEvidence, type GateActivityProbe, type GateActivityProbeStatus } from './activity-probes.js';
import { createBranchLocalGateCli, currentGateCliLaunch, readGateRouteReceipt, removeBranchLocalGateCli } from './branch-local-cli.js';
import { parseReviewGateVerdict } from './review-verdict.js';
interface GateCommandDependencies {
    buildCommandContext: (options: GlobalOptions) => CommandContext;
    resolveProjectRoot: (cwd: string) => Promise<string>;
    readOatConfig: (repoRoot: string) => Promise<OatConfig>;
    writeOatConfig: (repoRoot: string, config: OatConfig) => Promise<void>;
    readOatLocalConfig: (repoRoot: string) => Promise<OatLocalConfig>;
    writeOatLocalConfig: (repoRoot: string, config: OatLocalConfig) => Promise<void>;
    readUserConfig: (userConfigDir: string) => Promise<UserConfig>;
    writeUserConfig: (userConfigDir: string, config: UserConfig) => Promise<void>;
    resolveEffectiveConfig: (repoRoot: string, userConfigDir: string, env: NodeJS.ProcessEnv) => Promise<ResolvedConfig>;
    createGateActivityProbe: typeof createGateActivityProbe;
    createBranchLocalGateCli: typeof createBranchLocalGateCli;
    currentGateCliLaunch: typeof currentGateCliLaunch;
    removeBranchLocalGateCli: typeof removeBranchLocalGateCli;
    readGateRouteReceipt: typeof readGateRouteReceipt;
    runProcess: (command: string, args: string[], options: ProcessRunOptions) => Promise<ProcessRunResult>;
    parseReviewGateVerdict: typeof parseReviewGateVerdict;
    appendProjectLog: typeof appendProjectLog;
    processEnv: NodeJS.ProcessEnv;
    writeGateRunMarker: (path: string, marker: GateRunMarker, warn: (message: string) => void) => Promise<boolean>;
    removeGateRunMarker: (path: string, warn: (message: string) => void) => Promise<void>;
    writeDiagnostic: (message: string) => void;
}
interface ProcessRunOptions {
    activityProbe?: GateActivityProbe;
    cwd: string;
    env: NodeJS.ProcessEnv;
    livenessIntervalMs?: number;
    onLiveness?: (snapshot: GateLivenessSnapshot) => void;
    purpose: 'host-detection' | 'availability' | 'execute';
    stdin: 'ignore' | 'inherit';
    stdio: 'ignore' | 'inherit' | 'pipe';
    timeoutMs: number;
}
interface ProcessRunResult {
    activityEvidence?: GateActivityEvidence;
    activityProbeStatus?: GateActivityProbeStatus;
    capturedOutput?: string;
    exitCode: number;
    refusal?: string;
    stderrBytes: number;
    stdoutBytes: number;
    timedOut?: boolean;
}
interface GateLivenessSnapshot {
    elapsedMs: number;
    hardBudgetMs: number;
    idleMs: number;
    processAlive: boolean;
    activityProbeStatus?: GateActivityProbeStatus;
    lastActivityEvidence?: GateActivityEvidence;
}
type GateTimeoutSource = 'cli' | 'target' | 'config' | 'env' | 'scope-default' | 'default';
interface GateRunMarker {
    runId: string;
    targetId: string;
    runtime: string;
    reviewType: string | null;
    reviewScope: string | null;
    project: string;
    startedAt: string;
    budgetMs: number;
    budgetSource: GateTimeoutSource;
}
type CrossProviderAvoid = 'same-family' | 'same-runtime' | 'none';
type GateDiversityAchieved = 'different-family' | 'degraded-to-different-slug' | 'same-family - no diverse target available' | 'unknown-producer';
export interface SelectedExecTarget {
    id: string;
    target: ExecTarget;
    model?: string;
    family: ModelFamily;
    diversity?: GateDiversityMetadata;
    noDiverseFamilyFallback?: boolean;
}
interface GateProducerIdentity {
    value: string;
    provenance: IdentityProvenance;
    confidence: IdentityConfidence;
    family: ModelFamily;
    avoidFamilies: ModelFamily[];
    contributingScopes?: string[];
    contributingStampCount?: number;
    diversityClaimable: boolean;
    source: 'flag' | 'stamp' | 'aggregated-stamps' | 'environment' | 'unknown';
}
interface GateDiversityMetadata {
    avoid: CrossProviderAvoid;
    achieved: GateDiversityAchieved;
    producer: {
        value: string;
        provenance: IdentityProvenance;
        confidence: IdentityConfidence;
        family: ModelFamily;
        source: GateProducerIdentity['source'];
        avoidFamilies: ModelFamily[];
        contributingScopes?: string[];
        contributingStampCount?: number;
    };
    reviewer: {
        target: string;
        runtime: string;
        family: ModelFamily;
        model?: string;
    };
    warning?: string;
}
export declare function selectExecTarget(registry: Readonly<Record<string, ExecTarget>>, currentRuntime: string, avoid: CrossProviderAvoid, producerIdentity?: GateProducerIdentity): SelectedExecTarget | null;
export declare function createGateCommand(overrides?: Partial<GateCommandDependencies>): Command;
export {};
//# sourceMappingURL=index.d.ts.map