@dollhousemcp/mcp-server
Version:
DollhouseMCP - A Model Context Protocol (MCP) server that enables dynamic AI persona management from markdown files, allowing Claude and other compatible AI assistants to activate and switch between different behavioral personas.
41 lines • 1.41 kB
TypeScript
/**
* EarlyTerminationSearch - Utility for parallel searches with early termination
*
* Optimizes search operations by terminating when exact matches are found,
* while still providing comprehensive results for diagnostics.
*/
export interface SearchResult<T> {
success: boolean;
result: T | null;
error?: string;
}
export interface EarlyTerminationResult<T> {
matches: T[];
exactMatch?: T;
totalSearches: number;
completedSearches: number;
failures: Array<{
index: number;
error: string;
}>;
earlyTerminationTriggered: boolean;
performanceGain?: string;
}
export declare class EarlyTerminationSearch {
/**
* Perform parallel searches with early termination when exact match found
* @param searches Array of search functions to execute
* @param isExactMatch Function to determine if a result is an exact match
* @param options Configuration options
*/
static executeWithEarlyTermination<T>(searches: Array<() => Promise<T | null>>, isExactMatch: (result: T) => boolean, options?: {
operationName?: string;
timeoutAfterExactMatch?: number;
maxParallelSearches?: number;
}): Promise<EarlyTerminationResult<T>>;
/**
* Process batch results and update the main results object
*/
private static processBatchResults;
}
//# sourceMappingURL=EarlyTerminationSearch.d.ts.map