export type AutopilotEventName = 'spec:created' | 'spec:status:approved' | 'spec:status:implementing' | 'spec:status:review' | 'spec:status:done' | 'drift:detected' | 'cron:daily'
/** SPEC-569: Progress events emitted by complete-loop autopilot actions. */
 | 'autopilot:action'
/** SPEC-583: SDD Flow orchestrator events. */
 | 'sdd-flow-started' | 'sdd-flow-stage-completed' | 'sdd-flow-completed'
/** SPEC-605: Plugin installation events. */
 | 'plugin:installed'
/** SPEC-622: Context pressure at or above 90% usage. */
 | 'context:pressure';
export interface AutopilotEvent {
    name: AutopilotEventName;
    specId?: string;
    projectPath: string;
    projectId: string;
    payload?: Record<string, unknown>;
}
/**
 * SPEC-569: Status of an autopilot complete-loop action emitted via
 * `autopilot:action` events on the event-bus.
 */
export type AutopilotActionStatus = 'started' | 'completed' | 'failed';
/**
 * SPEC-569: Names of the complete-loop autopilot actions that emit progress events.
 */
export type AutopilotActionName = 'autoCreateBranch' | 'autoScaffoldTdd' | 'autoCreatePr';
/**
 * SPEC-569: Payload structure for `autopilot:action` events.
 */
export interface AutopilotActionPayload {
    action: AutopilotActionName;
    specId: string;
    status: AutopilotActionStatus;
    /** Optional human-readable summary (completed/failed only). */
    summary?: string;
    /** Optional error message (failed only). */
    error?: string;
    [key: string]: unknown;
}
export interface TriggerCondition {
    minEstimatedHours?: number;
    riskLevel?: string[];
    minDriftScore?: number;
    /** Generic field-based condition: e.g. { field: 'score', operator: 'lt', value: 80 } */
    field?: string;
    operator?: 'lt' | 'gt' | 'lte' | 'gte' | 'eq';
    value?: number | string | boolean;
}
export interface TriggerRule {
    id: string;
    event: AutopilotEventName;
    action: string;
    enabled: boolean;
    condition?: TriggerCondition;
    description: string;
}
export interface AutopilotConfig {
    version: string;
    rules: Record<string, {
        enabled: boolean;
        threshold?: number;
    }>;
    /**
     * SPEC-569: Top-level feature flags for the complete-loop autopilot.
     * When true, the corresponding lifecycle side-effect fires automatically
     * (fire-and-forget) after update_status transitions.
     */
    /** SPEC-569: Auto-create a git branch when a spec becomes approved. */
    autoCreateBranch?: boolean;
    /** SPEC-569: Auto-scaffold TDD tests when a spec becomes approved. */
    autoScaffoldTdd?: boolean;
    /** SPEC-569: Auto-create a PR when a spec reaches done and passes the score gate. */
    autoCreatePr?: boolean;
    /**
     * SPEC-569: Minimum validate score (0-100) required to auto-create a PR.
     * Defaults to 85 when autoCreatePr is enabled but no threshold is configured.
     */
    autoMergeThreshold?: number;
    /** SPEC-688: Max concurrent agents. Default 5, hard cap 20. */
    maxConcurrentAgents?: number;
}
export interface AutopilotStatus {
    totalRules: number;
    enabledRules: number;
    disabledRules: string[];
    lastCronRun?: string;
}
export type AutopilotAction = 'enable' | 'disable' | 'status' | 'set-threshold';
export interface ActionContext {
    projectPath: string;
    projectId: string;
    specId?: string;
    payload?: Record<string, unknown>;
}
export interface ActionResult {
    success: boolean;
    summary: string;
    durationMs: number;
}
export type ActionHandler = (ctx: ActionContext) => Promise<ActionResult>;
export interface StatusChange {
    specId: string;
    from: string;
    to: string;
    at: string;
}
export interface ProjectStatus {
    updatedAt: string;
    totalSpecs: number;
    byStatus: Record<string, number>;
    byType: Record<string, number>;
    recentChanges: StatusChange[];
    version: string;
}
export interface ToolTokenUsage {
    input: number;
    output: number;
    calls: number;
}
export interface SessionTokenUsage {
    inputTokens: number;
    outputTokens: number;
    toolCalls: number;
    byTool: Record<string, ToolTokenUsage>;
}
export interface ModelPricing {
    inputPerMToken: number;
    outputPerMToken: number;
}
export interface PricingData {
    lastFetchedAt: string;
    providers: Record<string, Record<string, ModelPricing>>;
}
export interface ResolvedPricing {
    modelId: string;
    provider: string;
    inputPerMToken: number;
    outputPerMToken: number;
    detectionMethod: 'env_var' | 'client_hint' | 'tool_param';
    pricingSource: 'bundled' | 'cached';
}
//# sourceMappingURL=autopilot.d.ts.map