/**
 * Agent Registry Service
 *
 * Core service for agent registration, lifecycle management, and queries.
 *
 * @packageDocumentation
 */
import { type Agent, type Attestation, type AgentState, type AttestationType, type AttestationOutcome, type StateAction } from "@vorionsys/contracts/db";
/**
 * Domain code to bitmask mapping
 */
export declare const DOMAIN_BITS: Record<string, number>;
/**
 * Trust tier score ranges
 */
export declare const TRUST_TIER_RANGES: Record<number, {
    min: number;
    max: number;
}>;
/**
 * State to tier mapping
 */
export declare const STATE_TO_TIER: Record<AgentState, number | null>;
/**
 * Tier to state mapping
 */
export declare const TIER_TO_STATE: Record<number, AgentState>;
/**
 * Human approval gates - transitions that require human approval
 */
export declare const HUMAN_APPROVAL_GATES: Array<{
    from: AgentState;
    to: AgentState;
}>;
export interface RegisterAgentOptions {
    tenantId: string;
    organization: string;
    agentClass: string;
    domains: string[];
    level: number;
    version: string;
    description?: string;
    metadata?: Record<string, unknown>;
    contactEmail?: string;
}
export interface AgentQueryOptions {
    tenantId: string;
    organization?: string;
    domains?: string[];
    minLevel?: number;
    minTrustTier?: number;
    states?: AgentState[];
    limit?: number;
    offset?: number;
}
export interface SubmitAttestationOptions {
    agentId: string;
    tenantId: string;
    type: AttestationType;
    outcome: AttestationOutcome;
    action: string;
    evidence?: Record<string, unknown>;
    source?: string;
    sourceCarId?: string;
}
export interface StateTransitionOptions {
    agentId: string;
    tenantId: string;
    action: StateAction;
    reason: string;
    triggeredBy?: string;
    context?: Record<string, unknown>;
}
export interface StateTransitionResult {
    success: boolean;
    previousState: AgentState;
    newState: AgentState;
    transitionedAt: string;
    pendingApproval?: boolean;
    approvalRequestId?: string;
    error?: string;
}
export declare class AgentRegistryService {
    private db;
    constructor();
    /**
     * Register a new agent
     */
    registerAgent(options: RegisterAgentOptions): Promise<Agent>;
    /**
     * Get agent by CAR ID
     */
    getAgentByCarId(carId: string): Promise<Agent | null>;
    /**
     * Get agent by ID
     */
    getAgentById(id: string): Promise<Agent | null>;
    /**
     * Update agent metadata
     */
    updateAgent(id: string, updates: Partial<Pick<Agent, "description" | "metadata" | "contactEmail">>): Promise<Agent | null>;
    /**
     * Query agents with filters
     */
    queryAgents(options: AgentQueryOptions): Promise<{
        data: Agent[];
        total: number;
    }>;
    /**
     * Submit an attestation for an agent
     */
    submitAttestation(options: SubmitAttestationOptions): Promise<Attestation>;
    /**
     * Get attestations for an agent
     */
    getAttestations(agentId: string, limit?: number): Promise<Attestation[]>;
    /**
     * Process pending attestations and update trust scores
     */
    processAttestations(agentId: string): Promise<{
        processed: number;
        newScore: number;
    }>;
    /**
     * Transition agent state
     */
    transitionState(options: StateTransitionOptions): Promise<StateTransitionResult>;
    /**
     * Record a state transition
     */
    private recordTransition;
    /**
     * Create an approval request
     */
    private createApprovalRequest;
    /**
     * Apply a state change to an agent
     */
    private applyStateChange;
    /**
     * Check for automatic lifecycle actions (quarantine escalation, etc.)
     */
    checkLifecycleRules(agentId: string): Promise<void>;
    /**
     * Encode domain codes to bitmask
     */
    private encodeDomains;
    /**
     * Convert trust score to tier
     */
    private scoreToTier;
    /**
     * Calculate trust impact from an attestation
     */
    private calculateAttestationImpact;
}
export declare function createAgentRegistryService(): AgentRegistryService;
export declare function getAgentRegistryService(): AgentRegistryService;
//# sourceMappingURL=service.d.ts.map