import type { Database as DB } from 'better-sqlite3'; import type { AgentIntentStats, AgentKeyRow, AgentRow, AuditLogRow, BusinessVerificationRow, DelegationRow, DomainVerificationRow, DirectoryRoleRow, DnsCacheRow, FederatedAgentRow, FederatedTrustRow, IntentFrame, IntentLogRow, OrgAgentRow, OrgRow, ReportRow, RegisterRequest, TrustScoreRow, VerificationTier } from './types.js'; import { type DIDDocument } from './did.js'; export declare function createDatabase(dbPath?: string): DB; export declare function buildBeamDomain(orgName: string): string; export declare function createOrg(db: DB, input: { name: string; displayName: string; domain?: string | null; apiKeyHash: string; verificationToken: string; }): OrgRow; export declare function getOrg(db: DB, name: string): OrgRow | null; export declare function listOrgAgents(db: DB, orgName: string): Array>; export declare function markOrgVerified(db: DB, name: string): OrgRow | null; export declare function registerAgent(db: DB, data: RegisterRequest): AgentRow; export declare function getAgent(db: DB, beamId: string): AgentRow | null; export declare function deleteAgent(db: DB, beamId: string): boolean; export declare function setAgentEmailToken(db: DB, beamId: string, token: string | null): AgentRow | null; export declare function updateAgentProfile(db: DB, beamId: string, updates: { displayName?: string; capabilities?: string[]; email?: string | null; emailVerified?: boolean; verificationTier?: VerificationTier; description?: string | null; logoUrl?: string | null; website?: string | null; }): AgentRow | null; export declare function createVerificationToken(db: DB, input: { token?: string; beam_id: string; email: string; expires_at: number; }): { token: string; beam_id: string; email: string; created_at: number; expires_at: number; }; export declare function verifyAgentEmailToken(db: DB, token: string): AgentRow | null; export declare function findAgentByHandle(db: DB, handle: string): AgentRow | null; export declare function upsertDIDDocument(db: DB, document: DIDDocument): DIDDocument; export declare function getDIDDocument(db: DB, did: string): DIDDocument | null; export interface SearchQuery { org?: string; personal?: boolean; capabilities?: string[]; minTrustScore?: number; verificationTier?: VerificationTier; verifiedOnly?: boolean; limit?: number; offset?: number; } export declare function countSearchAgents(db: DB, query: SearchQuery): number; export declare function searchAgents(db: DB, query: SearchQuery): AgentRow[]; export declare function updateLastSeen(db: DB, beamId: string): void; export declare function recordNonce(db: DB, nonce: string): boolean; export declare function cleanExpiredNonces(db: DB): void; export declare function calculateTrustScore(db: DB, beamId: string): number; export declare function createDomainVerification(db: DB, input: { beamId: string; domain: string; challengeToken: string; }): DomainVerificationRow; export declare function getLatestDomainVerification(db: DB, beamId: string): DomainVerificationRow | null; export declare function updateDomainVerificationStatus(db: DB, id: number, status: string): DomainVerificationRow | null; export declare function createBusinessVerification(db: DB, input: { beamId: string; country: string; registrationNumber: string; legalName: string; status?: string; verificationSource?: string | null; sourceReference?: string | null; evidence?: unknown; verifiedAt?: string | null; }): BusinessVerificationRow; export declare function getLatestBusinessVerification(db: DB, beamId: string): BusinessVerificationRow | null; export declare function markAgentBusinessVerified(db: DB, beamId: string): AgentRow | null; export declare function markAgentDomainVerified(db: DB, beamId: string): AgentRow | null; export declare function rotateAgentKey(db: DB, beamId: string, newPublicKey: string): AgentRow | null; export declare function listRevokedAgentKeys(db: DB): AgentKeyRow[]; export declare function createDelegation(db: DB, input: { grantorBeamId: string; granteeBeamId: string; scope: string; expiresAt: number; }): DelegationRow; export declare function listActiveDelegations(db: DB, beamId: string, currentTime?: number): DelegationRow[]; export declare function revokeDelegation(db: DB, grantorBeamId: string, id: number): boolean; export declare function hasActiveDelegation(db: DB, input: { grantorBeamId: string; granteeBeamId: string; scope: string; currentTime?: number; }): boolean; export declare function createReport(db: DB, input: { reporterBeamId: string; targetBeamId: string; reason: string; }): ReportRow; export declare function getPendingReportCount(db: DB, targetBeamId: string): number; export declare function listReportsForTarget(db: DB, targetBeamId: string): ReportRow[]; export declare function logIntentStart(db: DB, frame: IntentFrame): void; export declare function finalizeIntentLog(db: DB, input: { nonce: string; fromBeamId: string; toBeamId: string; success: boolean; latencyMs: number | null; errorCode?: string; }): void; export declare function listRecentIntentLogs(db: DB, limit?: number): IntentLogRow[]; export declare function getAgentIntentStats(db: DB, beamId: string): AgentIntentStats; export declare function getAgentDirectoryStats(db: DB): { total_agents: number; verified_agents: number; intents_processed: number; avg_response_time_ms: number | null; }; export declare function listTrustScores(db: DB): TrustScoreRow[]; export declare function upsertFederatedAgentCache(db: DB, input: { beamId: string; homeDirectoryUrl: string; document: object; cachedAt?: string; ttl?: number; }): FederatedAgentRow; export declare function getFederatedAgentCache(db: DB, beamId: string): FederatedAgentRow | null; export declare function deleteFederatedAgentCache(db: DB, beamId: string): void; export declare function assignDirectoryRole(db: DB, input: { userId: string; role: DirectoryRoleRow['role']; directoryUrl: string; }): DirectoryRoleRow; export declare function getDirectoryRole(db: DB, userId: string, directoryUrl: string): DirectoryRoleRow | null; export declare function logAuditEvent(db: DB, input: { action: string; actor: string; target: string; details?: unknown; timestamp?: string; }): AuditLogRow; export declare function listAuditLog(db: DB, query?: { limit?: number; action?: string; actor?: string; target?: string; }): AuditLogRow[]; export declare function getDnsCache(db: DB, cacheKey: string, recordType: string): DnsCacheRow | null; export declare function setDnsCache(db: DB, input: { cacheKey: string; recordType: string; payload: unknown; ttlSeconds: number; }): DnsCacheRow; export declare function cleanExpiredDnsCache(db: DB): void; export declare function upsertFederatedTrust(db: DB, input: { beamId: string; sourceDirectoryUrl: string; originDirectoryUrl: string; assertedTrust: number; effectiveTrust: number; hopCount: number; assertedAt?: string; }): FederatedTrustRow; export declare function listFederatedTrust(db: DB, beamId?: string): FederatedTrustRow[];