/**
 * Centralized Governance API for the Oversight Command Center.
 *
 * Provides REST-style endpoint handlers for:
 * - Event ingestion from governed installations
 * - Status queries across agents and tenants
 * - Configuration management
 * - Report generation
 *
 * These are handler functions, not a running HTTP server.
 * The consuming application (my-cc.io or any Express/Fastify app) wires
 * these handlers to its own routing layer.
 *
 * @connexum/ai-governance
 */
export interface GovernanceEvent {
    /** Unique event ID */
    id: string;
    /** ISO timestamp */
    timestamp: string;
    /** Source installation identifier */
    installationId: string;
    /** Tenant within the installation */
    tenantId?: string;
    /** Agent that triggered the event */
    agentId: string;
    /** Event type */
    type: 'tool_call' | 'violation' | 'anomaly' | 'circuit_break' | 'tamper' | 'audit' | 'custom';
    /** Event severity */
    severity: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
    /** Tool or action involved */
    tool?: string;
    /** Decision made */
    decision?: 'ALLOW' | 'DENY' | 'APPROVAL_REQUIRED';
    /** Event details */
    detail: string;
    /** Additional metadata */
    metadata?: Record<string, unknown>;
}
export interface AgentStatus {
    agentId: string;
    installationId: string;
    tenantId?: string;
    state: 'active' | 'suspended' | 'idle' | 'unknown';
    lastSeen: string;
    circuitBreakerState: 'CLOSED' | 'OPEN' | 'HALF_OPEN';
    totalActions: number;
    blockedActions: number;
    anomalyCount: number;
    complianceScore: number;
}
export interface InstallationStatus {
    installationId: string;
    name: string;
    agents: AgentStatus[];
    activePacks: string[];
    lastEvent: string;
    overallScore: number;
    eventCount: number;
}
export interface DashboardSummary {
    totalInstallations: number;
    totalAgents: number;
    activeAgents: number;
    suspendedAgents: number;
    totalEvents: number;
    criticalEvents: number;
    averageComplianceScore: number;
    lastUpdated: string;
}
export interface EventQuery {
    installationId?: string;
    tenantId?: string;
    agentId?: string;
    type?: GovernanceEvent['type'];
    severity?: GovernanceEvent['severity'];
    since?: string;
    limit?: number;
    offset?: number;
}
export interface APIResponse<T> {
    success: boolean;
    data?: T;
    error?: string;
    timestamp: string;
}
export interface GovernanceAPIConfig {
    /** Directory for storing events and state */
    dataDir: string;
    /** Maximum events to retain in memory (default: 10000) */
    maxEvents?: number;
    /** API key for authentication (required for ingest) */
    apiKey?: string;
}
export declare class GovernanceAPI {
    private config;
    private events;
    private agents;
    private installations;
    private eventsFile;
    private stateFile;
    constructor(config: GovernanceAPIConfig);
    /**
     * Ingest a governance event from a client installation.
     */
    ingestEvent(event: GovernanceEvent, apiKey?: string): APIResponse<{
        eventId: string;
    }>;
    /**
     * Query events with filters.
     */
    queryEvents(query?: EventQuery): APIResponse<{
        events: GovernanceEvent[];
        total: number;
    }>;
    /**
     * Get agent status.
     */
    getAgentStatus(agentId: string): APIResponse<AgentStatus>;
    /**
     * List all agents with optional filters.
     */
    listAgents(installationId?: string): APIResponse<AgentStatus[]>;
    /**
     * Get installation status.
     */
    getInstallation(installationId: string): APIResponse<InstallationStatus>;
    /**
     * List all installations.
     */
    listInstallations(): APIResponse<InstallationStatus[]>;
    /**
     * Get dashboard summary.
     */
    getSummary(): APIResponse<DashboardSummary>;
    /**
     * Get event counts grouped by type.
     */
    getEventBreakdown(installationId?: string): APIResponse<Record<string, number>>;
    /**
     * Get the total number of stored events.
     */
    get eventCount(): number;
    /**
     * Get the total number of tracked agents.
     */
    get agentCount(): number;
    private updateAgentStatus;
    private updateInstallationStatus;
    private appendEvent;
    private saveState;
    private loadState;
    private ok;
    private error;
    private ensureDir;
}
//# sourceMappingURL=api.d.ts.map