/**
 * Audit Engine Type Definitions
 *
 * Defines audit events, records, and related types for comprehensive
 * audit logging with chain integrity.
 *
 * Note: These audit types are designed to work with both legacy types
 * from src/common/types.ts and canonical types from @vorionsys/contracts.
 * For canonical proof/evidence types, see packages/contracts/src/v2/evidence.ts
 * and packages/contracts/src/v2/proof-event.ts.
 *
 * @packageDocumentation
 */
import type { ID, Timestamp } from '../common/types.js';
export declare const AUDIT_SEVERITIES: readonly ["info", "warning", "error", "critical"];
export type AuditSeverity = (typeof AUDIT_SEVERITIES)[number];
export declare const AUDIT_OUTCOMES: readonly ["success", "failure", "partial"];
export type AuditOutcome = (typeof AUDIT_OUTCOMES)[number];
export declare const AUDIT_CATEGORIES: readonly ["intent", "policy", "escalation", "authentication", "authorization", "data", "system", "admin"];
export type AuditCategory = (typeof AUDIT_CATEGORIES)[number];
export declare const AUDIT_EVENT_TYPES: {
    readonly 'intent.created': {
        readonly category: "intent";
        readonly severity: "info";
    };
    readonly 'intent.submitted': {
        readonly category: "intent";
        readonly severity: "info";
    };
    readonly 'intent.evaluation.started': {
        readonly category: "intent";
        readonly severity: "info";
    };
    readonly 'intent.evaluation.completed': {
        readonly category: "intent";
        readonly severity: "info";
    };
    readonly 'intent.approved': {
        readonly category: "intent";
        readonly severity: "info";
    };
    readonly 'intent.denied': {
        readonly category: "intent";
        readonly severity: "warning";
    };
    readonly 'intent.escalated': {
        readonly category: "intent";
        readonly severity: "warning";
    };
    readonly 'intent.execution.started': {
        readonly category: "intent";
        readonly severity: "info";
    };
    readonly 'intent.completed': {
        readonly category: "intent";
        readonly severity: "info";
    };
    readonly 'intent.failed': {
        readonly category: "intent";
        readonly severity: "error";
    };
    readonly 'intent.cancelled': {
        readonly category: "intent";
        readonly severity: "warning";
    };
    readonly 'intent.status.changed': {
        readonly category: "intent";
        readonly severity: "info";
    };
    readonly 'intent.replayed': {
        readonly category: "intent";
        readonly severity: "info";
    };
    readonly 'intent.deleted': {
        readonly category: "intent";
        readonly severity: "warning";
    };
    readonly 'policy.created': {
        readonly category: "policy";
        readonly severity: "info";
    };
    readonly 'policy.updated': {
        readonly category: "policy";
        readonly severity: "info";
    };
    readonly 'policy.published': {
        readonly category: "policy";
        readonly severity: "info";
    };
    readonly 'policy.deprecated': {
        readonly category: "policy";
        readonly severity: "warning";
    };
    readonly 'policy.archived': {
        readonly category: "policy";
        readonly severity: "warning";
    };
    readonly 'policy.evaluation.started': {
        readonly category: "policy";
        readonly severity: "info";
    };
    readonly 'policy.evaluation.completed': {
        readonly category: "policy";
        readonly severity: "info";
    };
    readonly 'policy.violation': {
        readonly category: "policy";
        readonly severity: "warning";
    };
    readonly 'escalation.created': {
        readonly category: "escalation";
        readonly severity: "warning";
    };
    readonly 'escalation.acknowledged': {
        readonly category: "escalation";
        readonly severity: "info";
    };
    readonly 'escalation.approved': {
        readonly category: "escalation";
        readonly severity: "info";
    };
    readonly 'escalation.rejected': {
        readonly category: "escalation";
        readonly severity: "warning";
    };
    readonly 'escalation.timeout': {
        readonly category: "escalation";
        readonly severity: "error";
    };
    readonly 'escalation.cancelled': {
        readonly category: "escalation";
        readonly severity: "warning";
    };
    readonly 'escalation.sla.breached': {
        readonly category: "escalation";
        readonly severity: "critical";
    };
    readonly 'auth.login': {
        readonly category: "authentication";
        readonly severity: "info";
    };
    readonly 'auth.logout': {
        readonly category: "authentication";
        readonly severity: "info";
    };
    readonly 'auth.failed': {
        readonly category: "authentication";
        readonly severity: "warning";
    };
    readonly 'auth.token.issued': {
        readonly category: "authentication";
        readonly severity: "info";
    };
    readonly 'auth.token.revoked': {
        readonly category: "authentication";
        readonly severity: "info";
    };
    readonly 'auth.token.expired': {
        readonly category: "authentication";
        readonly severity: "info";
    };
    readonly 'authz.denied': {
        readonly category: "authorization";
        readonly severity: "warning";
    };
    readonly 'authz.granted': {
        readonly category: "authorization";
        readonly severity: "info";
    };
    readonly 'authz.elevated': {
        readonly category: "authorization";
        readonly severity: "warning";
    };
    readonly 'data.read': {
        readonly category: "data";
        readonly severity: "info";
    };
    readonly 'data.created': {
        readonly category: "data";
        readonly severity: "info";
    };
    readonly 'data.updated': {
        readonly category: "data";
        readonly severity: "info";
    };
    readonly 'data.deleted': {
        readonly category: "data";
        readonly severity: "warning";
    };
    readonly 'data.exported': {
        readonly category: "data";
        readonly severity: "warning";
    };
    readonly 'system.startup': {
        readonly category: "system";
        readonly severity: "info";
    };
    readonly 'system.shutdown': {
        readonly category: "system";
        readonly severity: "info";
    };
    readonly 'system.error': {
        readonly category: "system";
        readonly severity: "error";
    };
    readonly 'system.warning': {
        readonly category: "system";
        readonly severity: "warning";
    };
    readonly 'system.config.changed': {
        readonly category: "system";
        readonly severity: "info";
    };
    readonly 'admin.user.created': {
        readonly category: "admin";
        readonly severity: "info";
    };
    readonly 'admin.user.updated': {
        readonly category: "admin";
        readonly severity: "info";
    };
    readonly 'admin.user.deleted': {
        readonly category: "admin";
        readonly severity: "warning";
    };
    readonly 'admin.permission.granted': {
        readonly category: "admin";
        readonly severity: "info";
    };
    readonly 'admin.permission.revoked': {
        readonly category: "admin";
        readonly severity: "warning";
    };
    readonly 'admin.user_modified': {
        readonly category: "admin";
        readonly severity: "info";
    };
    readonly 'admin.token_revoked': {
        readonly category: "admin";
        readonly severity: "warning";
    };
    readonly 'access.denied': {
        readonly category: "authorization";
        readonly severity: "warning";
    };
    readonly 'access.granted': {
        readonly category: "authorization";
        readonly severity: "info";
    };
    readonly 'trust_score.updated': {
        readonly category: "data";
        readonly severity: "info";
    };
    readonly 'trust_score.recalculated': {
        readonly category: "data";
        readonly severity: "info";
    };
    readonly 'escalation.assigned': {
        readonly category: "escalation";
        readonly severity: "info";
    };
    readonly 'policy.deleted': {
        readonly category: "policy";
        readonly severity: "warning";
    };
};
export type AuditEventType = keyof typeof AUDIT_EVENT_TYPES;
export declare const ACTOR_TYPES: readonly ["user", "agent", "service", "system"];
export type ActorType = (typeof ACTOR_TYPES)[number];
export declare const TARGET_TYPES: readonly ["intent", "policy", "escalation", "entity", "agent", "tenant", "user", "system", "role", "permission", "service_account"];
export type TargetType = (typeof TARGET_TYPES)[number];
/**
 * Actor information
 */
export interface AuditActor {
    type: ActorType;
    id: ID;
    name?: string;
    ip?: string;
}
/**
 * Target of the audited action
 */
export interface AuditTarget {
    type: TargetType;
    id: ID;
    name?: string;
}
/**
 * State change tracking
 */
export interface AuditStateChange {
    before?: Record<string, unknown>;
    after?: Record<string, unknown>;
    diff?: Record<string, unknown>;
}
/**
 * Complete audit record as stored in database
 */
export interface AuditRecord {
    id: ID;
    tenantId: ID;
    eventType: AuditEventType | string;
    eventCategory: AuditCategory;
    severity: AuditSeverity;
    actor: AuditActor;
    target: AuditTarget;
    requestId: ID;
    traceId?: string | null;
    spanId?: string | null;
    action: string;
    outcome: AuditOutcome;
    reason?: string | null;
    stateChange?: AuditStateChange | null;
    metadata?: Record<string, unknown> | null;
    tags?: string[] | null;
    sequenceNumber: number;
    previousHash?: string | null;
    recordHash: string;
    eventTime: Timestamp;
    recordedAt: Timestamp;
    archived: boolean;
    archivedAt?: Timestamp | null;
}
/**
 * Input for creating an audit record
 */
export interface CreateAuditRecordInput {
    tenantId: ID;
    eventType: AuditEventType | string;
    actor: AuditActor;
    target: AuditTarget;
    action: string;
    outcome: AuditOutcome;
    reason?: string;
    stateChange?: AuditStateChange;
    metadata?: Record<string, unknown>;
    tags?: string[];
    requestId?: ID;
    traceId?: string;
    spanId?: string;
    eventTime?: Timestamp;
}
export interface AuditQueryFilters {
    tenantId: ID;
    eventType?: AuditEventType | string;
    eventCategory?: AuditCategory;
    severity?: AuditSeverity;
    actorId?: ID;
    actorType?: ActorType;
    targetId?: ID;
    targetType?: TargetType;
    outcome?: AuditOutcome;
    requestId?: ID;
    traceId?: string;
    tags?: string[];
    startTime?: Timestamp;
    endTime?: Timestamp;
    limit?: number;
    offset?: number;
    orderBy?: 'eventTime' | 'recordedAt';
    orderDirection?: 'asc' | 'desc';
}
/**
 * Paginated audit query result
 */
export interface AuditQueryResult {
    records: AuditRecord[];
    total: number;
    hasMore: boolean;
}
/**
 * Result of chain integrity verification
 */
export interface ChainIntegrityResult {
    valid: boolean;
    recordsChecked: number;
    firstRecord?: ID;
    lastRecord?: ID;
    brokenAt?: ID;
    error?: string;
}
/**
 * Result of audit archive operation
 */
export interface AuditArchiveResult {
    recordsArchived: number;
    durationMs: number;
    oldestArchivedDate?: Timestamp;
    newestArchivedDate?: Timestamp;
}
/**
 * Result of audit purge operation
 */
export interface AuditPurgeResult {
    recordsPurged: number;
    durationMs: number;
    oldestPurgedDate?: Timestamp;
    newestPurgedDate?: Timestamp;
}
/**
 * Combined result of audit cleanup operation
 */
export interface AuditCleanupResult {
    archived: AuditArchiveResult;
    purged: AuditPurgeResult;
    totalDurationMs: number;
    errors: string[];
}
//# sourceMappingURL=types.d.ts.map