/**
 * Trust Negotiation Service
 *
 * Handles trust verification and negotiation between agents for A2A communication.
 * Verifies caller/callee trust requirements and generates trust proofs.
 *
 * @packageDocumentation
 */
import { type TrustContext, type TrustProof, type TrustRequirements, type DelegationToken, type ChainLink, type ChainContext } from './types.js';
/**
 * Trust verification result
 */
export interface TrustVerificationResult {
    /** Verification passed */
    verified: boolean;
    /** Effective trust tier after verification */
    effectiveTier: number;
    /** Effective trust score after verification */
    effectiveScore: number;
    /** Reason for failure (if not verified) */
    reason?: string;
    /** Warnings (non-fatal issues) */
    warnings: string[];
    /** Delegation used (if any) */
    delegationUsed?: DelegationToken;
}
/**
 * Trust negotiation result
 */
export interface NegotiationResult {
    /** Negotiation succeeded */
    success: boolean;
    /** Agreed trust requirements */
    agreedRequirements?: TrustRequirements;
    /** Reason for failure */
    reason?: string;
    /** Counter-proposal (if rejected) */
    counterProposal?: TrustRequirements;
}
/**
 * Agent trust info from registry
 */
export interface AgentTrustInfo {
    carId: string;
    tier: number;
    score: number;
    tenantId: string;
    capabilities: string[];
    state: string;
}
/**
 * Trust info provider interface (injected dependency)
 */
export interface TrustInfoProvider {
    getAgentTrust(carId: string): Promise<AgentTrustInfo | null>;
    validateTrustProof(proof: TrustProof): Promise<boolean>;
}
export declare class TrustNegotiationService {
    private signingKey;
    private trustProvider;
    constructor(signingKey: string, trustProvider: TrustInfoProvider);
    /**
     * Verify caller trust for an A2A invocation
     */
    verifyCallerTrust(callerCarId: string, calleeCarId: string, trustContext: TrustContext, requirements?: TrustRequirements): Promise<TrustVerificationResult>;
    /**
     * Verify a trust proof
     */
    verifyTrustProof(proof: TrustProof, expectedCarId: string): Promise<boolean>;
    /**
     * Generate a trust proof for an agent
     */
    generateTrustProof(carId: string): Promise<TrustProof | null>;
    /**
     * Sign a trust proof
     */
    private signProof;
    /**
     * Verify a delegation token
     */
    verifyDelegation(delegation: DelegationToken, delegateCarId: string, targetCarId: string): Promise<{
        valid: boolean;
        maxTier: number;
        reason?: string;
    }>;
    /**
     * Get delegation chain length
     */
    private getDelegationChainLength;
    /**
     * Calculate trust floor from call chain
     */
    calculateChainTrustFloor(chain: ChainLink[]): {
        tier: number;
        score: number;
    };
    /**
     * Build chain context for nested call
     */
    buildChainContext(callerCarId: string, callerTier: number, callerScore: number, action: string, requestId: string, parentContext?: ChainContext): ChainContext;
    /**
     * Validate chain context
     */
    validateChainContext(context: ChainContext): {
        valid: boolean;
        reason?: string;
    };
    /**
     * Negotiate trust requirements between caller and callee
     */
    negotiate(callerCarId: string, calleeCarId: string, callerRequirements: TrustRequirements, calleeRequirements: TrustRequirements): Promise<NegotiationResult>;
    /**
     * Build TrustContext for an A2A call
     */
    buildTrustContext(callerCarId: string, delegation?: DelegationToken, parentChain?: ChainContext): Promise<TrustContext | null>;
}
export declare function createTrustNegotiationService(signingKey: string, trustProvider: TrustInfoProvider): TrustNegotiationService;
export declare function getTrustNegotiationService(): TrustNegotiationService;
//# sourceMappingURL=trust-negotiation.d.ts.map