anon-identity
Version:
Decentralized identity framework with DIDs, Verifiable Credentials, and privacy-preserving selective disclosure
72 lines • 2.36 kB
TypeScript
import { ActivityIndex } from './activity-index';
import { IPFSActivityStorage } from './ipfs-activity-storage';
import { AgentActivity, ActivityQuery, ActivitySearchResult, ActivitySummary } from './types';
export interface SearchServiceConfig {
enableIPFSFallback?: boolean;
cacheResults?: boolean;
maxCacheSize?: number;
cacheTTL?: number;
}
export interface CachedResult {
result: ActivitySearchResult;
timestamp: Date;
queryHash: string;
}
export declare class ActivitySearchService {
private index;
private ipfsStorage?;
private config;
private resultCache;
constructor(index: ActivityIndex, ipfsStorage?: IPFSActivityStorage, config?: SearchServiceConfig);
/**
* Search activities with advanced querying capabilities
*/
searchActivities(query: ActivityQuery): Promise<ActivitySearchResult>;
/**
* Get activity summary with aggregated statistics
*/
getActivitySummary(agentDID: string, period: 'hour' | 'day' | 'week' | 'month' | 'year', startDate?: Date): Promise<ActivitySummary>;
/**
* Get recent activities for an agent
*/
getRecentActivities(agentDID: string, limit?: number): Promise<AgentActivity[]>;
/**
* Get activities by session ID
*/
getSessionActivities(sessionId: string): Promise<AgentActivity[]>;
/**
* Search activities by text content (searches in activity details)
*/
searchByText(searchText: string, agentDID?: string, limit?: number): Promise<AgentActivity[]>;
/**
* Get activity trends over time
*/
getActivityTrends(agentDID: string, days?: number): Promise<{
date: string;
count: number;
byType: Record<string, number>;
errorRate: number;
}[]>;
/**
* Get comparative statistics between agents
*/
compareAgents(agentDIDs: string[], period?: 'day' | 'week' | 'month'): Promise<Record<string, ActivitySummary>>;
/**
* Clear the search cache
*/
clearCache(): void;
/**
* Get cache statistics
*/
getCacheStats(): {
size: number;
maxSize: number;
hitRate: number;
};
private getCachedResult;
private cacheResult;
private hashQuery;
private shouldTryIPFSFallback;
private enhanceWithIPFS;
}
//# sourceMappingURL=activity-search-service.d.ts.map