/**
 * Identity Management System for XMCP-I Runtime
 *
 * Handles identity loading, generation, and validation for both development
 * and production environments according to requirements 4.1-4.4.
 */
/**
 * Agent identity structure
 */
export interface AgentIdentity {
    did: string;
    kid: string;
    privateKey: string;
    publicKey: string;
    createdAt: string;
    lastRotated?: string;
}
/**
 * Development identity file structure (.mcpi/identity.json)
 */
export interface DevIdentityFile {
    version: string;
    did: string;
    kid: string;
    privateKey: string;
    publicKey: string;
    createdAt: string;
    lastRotated?: string;
}
/**
 * Production environment variables
 */
export interface ProdEnvironment {
    AGENT_PRIVATE_KEY: string;
    AGENT_KEY_ID: string;
    AGENT_DID: string;
    KYA_VOUCHED_API_KEY: string;
}
/**
 * Runtime Identity Manager Configuration
 *
 * Configuration for the IdentityManager class in the MCP-I runtime.
 * Controls how identity is loaded and managed at runtime.
 */
export interface RuntimeIdentityManagerConfig {
    environment: "development" | "production";
    devIdentityPath?: string;
    privacyMode?: boolean;
    debug?: boolean;
}
/**
 * Error codes for identity management
 */
export declare const IDENTITY_ERRORS: {
    readonly ENOIDENTITY: "XMCP_I_ENOIDENTITY";
    readonly ECONFIG: "XMCP_I_ECONFIG";
};
/**
 * Identity management class
 */
export declare class IdentityManager {
    private config;
    private cachedIdentity?;
    constructor(config?: RuntimeIdentityManagerConfig);
    /**
     * Load or generate agent identity
     * Requirements: 4.1, 4.2, 4.3, 4.4
     */
    ensureIdentity(): Promise<AgentIdentity>;
    /**
     * Load development identity from .mcpi/identity.json or generate new one
     * Requirement: 4.1
     */
    private loadOrGenerateDevIdentity;
    /**
     * Generate new development identity
     * Requirements: 4.1, 4.4
     */
    private generateDevIdentity;
    /**
     * Generate multibase-encoded key identifier (z-prefix base58btc)
     */
    private generateMultibaseKid;
    /**
     * Simple base58 encoding (matching well-known.ts implementation)
     */
    private encodeBase58;
    /**
     * Save development identity to .mcpi/identity.json
     */
    private saveDevIdentity;
    /**
     * Load production identity from environment variables
     * Requirements: 4.2, 4.3
     */
    private loadProdIdentity;
    /**
     * Derive the real Ed25519 public key from a raw private key seed.
     *
     * Ed25519 public keys are a deterministic function of the private key, so
     * this recovers the actual key rather than approximating one. A previous
     * version of this method returned a SHA-256 digest of the private key as
     * a "placeholder public key" — cryptographically meaningless, and wrong
     * wherever an AgentIdentity's publicKey is later published or used to
     * build a kid (e.g. migrate-identity.ts, well-known.ts).
     */
    private derivePublicKey;
    /**
     * Validate identity configuration
     */
    validateIdentity(identity: AgentIdentity): Promise<boolean>;
    /**
     * Clear cached identity (useful for testing)
     */
    clearCache(): void;
    /**
     * Get current configuration
     */
    getConfig(): RuntimeIdentityManagerConfig;
}
/**
 * Default identity manager instance
 */
export declare const defaultIdentityManager: IdentityManager;
/**
 * Extract agent ID from DID
 * @deprecated Use extractAgentId from @kya-os/mcp-i-runtime/utils/did-helpers instead
 * This re-export is maintained for backward compatibility
 */
export { extractAgentId } from '@kya-os/mcp-i-runtime/utils/did-helpers';
/**
 * Extract agent slug from DID
 * @deprecated Use extractAgentSlug from @kya-os/mcp-i-runtime/utils/did-helpers instead
 * This re-export is maintained for backward compatibility
 */
export { extractAgentSlug } from '@kya-os/mcp-i-runtime/utils/did-helpers';
/**
 * Convenience function to ensure identity
 */
export declare function ensureIdentity(config?: RuntimeIdentityManagerConfig): Promise<AgentIdentity>;
