import type { Entity } from "../types/environment";
import type { JsonValue, UUID } from "../types/primitives";
import type { IAgentRuntime } from "../types/runtime";
import { Service } from "../types/service";
export interface ContactCategory {
    id: string;
    name: string;
    description?: string;
    color?: string;
}
export interface ContactPreferences {
    preferredCommunicationChannel?: string;
    timezone?: string;
    language?: string;
    contactFrequency?: "daily" | "weekly" | "monthly" | "quarterly";
    doNotDisturb?: boolean;
    notes?: string;
    /** Index signature for metadata compatibility */
    [key: string]: string | boolean | undefined;
}
export interface ContactInfo {
    entityId: UUID;
    categories: string[];
    tags: string[];
    preferences: ContactPreferences;
    customFields: Record<string, JsonValue>;
    privacyLevel: "public" | "private" | "restricted";
    lastModified: string;
}
export interface RelationshipAnalytics {
    strength: number;
    interactionCount: number;
    sharedConversationWindows?: number;
    lastInteractionAt?: string;
    averageResponseTime?: number;
    sentimentScore?: number;
    topicsDiscussed: string[];
}
export interface FollowUpSchedule {
    entityId: UUID;
    scheduledAt: string;
    reason: string;
    priority: "high" | "medium" | "low";
    completed: boolean;
    taskId?: UUID;
}
export declare enum EntityLifecycleEvent {
    CREATED = "entity:created",
    UPDATED = "entity:updated",
    MERGED = "entity:merged",
    RESOLVED = "entity:resolved"
}
export interface EntityEventData {
    entity: Entity;
    previousEntity?: Entity;
    mergedEntities?: Entity[];
    source?: string;
    confidence?: number;
}
/**
 * Calculate relationship strength based on interaction patterns
 */
export declare function calculateRelationshipStrength({ interactionCount, lastInteractionAt, messageQuality, relationshipType, sharedConversationWindows, }: {
    interactionCount: number;
    lastInteractionAt?: string;
    messageQuality?: number;
    relationshipType?: string;
    sharedConversationWindows?: number;
}): number;
type RelationshipMessageLike = {
    entityId?: UUID;
    roomId?: UUID;
    createdAt?: number | string | null;
};
export declare function countSharedConversationWindows(messages: RelationshipMessageLike[], leftEntityId: UUID, rightEntityId: UUID, windowMs?: number): number;
export declare class RelationshipsService extends Service {
    static serviceType: "relationships";
    capabilityDescription: string;
    private contactInfoCache;
    private analyticsCache;
    private categoriesCache;
    private static readonly CONTACT_CACHE_LIMIT;
    private static readonly ANALYTICS_CACHE_LIMIT;
    private setCacheWithLimit;
    private getRelationshipsWorldId;
    private getRelationshipsRoomId;
    private isRelationshipsContactComponent;
    private getStoredContactComponent;
    private cacheContactInfoFromEntities;
    initialize(runtime: IAgentRuntime): Promise<void>;
    stop(): Promise<void>;
    static start(runtime: IAgentRuntime): Promise<Service>;
    private loadContactInfoFromComponents;
    addContact(entityId: UUID, categories?: string[], preferences?: ContactPreferences, customFields?: Record<string, JsonValue>): Promise<ContactInfo>;
    updateContact(entityId: UUID, updates: Partial<ContactInfo>): Promise<ContactInfo | null>;
    getContact(entityId: UUID): Promise<ContactInfo | null>;
    removeContact(entityId: UUID): Promise<boolean>;
    searchContacts(criteria: {
        categories?: string[];
        tags?: string[];
        searchTerm?: string;
        privacyLevel?: string;
    }): Promise<ContactInfo[]>;
    analyzeRelationship(sourceEntityId: UUID, targetEntityId: UUID): Promise<RelationshipAnalytics | null>;
    getRelationshipInsights(entityId: UUID): Promise<{
        strongestRelationships: Array<{
            entity: Entity;
            analytics: RelationshipAnalytics;
        }>;
        needsAttention: Array<{
            entity: Entity;
            daysSinceContact: number;
        }>;
        recentInteractions: Array<{
            entity: Entity;
            lastInteraction: string;
        }>;
    }>;
    getCategories(): Promise<ContactCategory[]>;
    addCategory(category: ContactCategory): Promise<void>;
    setContactPrivacy(entityId: UUID, privacyLevel: "public" | "private" | "restricted"): Promise<boolean>;
    canAccessContact(requestingEntityId: UUID, targetEntityId: UUID): Promise<boolean>;
}
export {};
//# sourceMappingURL=relationships.d.ts.map