/**
 * Tool Name Sanitizer
 *
 * Sanitizes MCP tool names to comply with Gemini API constraints:
 * - Max 64 characters
 * - Must start with letter or underscore
 * - Only a-z A-Z 0-9 _ . : - / allowed
 *
 * Strategies:
 * 1. Remove duplicate segments (e.g., gitmcp__foo__foo → gitmcp__foo)
 * 2. Smart truncate with hash suffix if still >64 chars
 *
 * Note: Hash collision risk is ~1 in 16M with 6-char MD5 prefix.
 * Acceptable for typical MCP tool counts (<1000 tools).
 */
/** Maximum tool name length allowed by Gemini API */
export declare const GEMINI_MAX_TOOL_NAME_LENGTH = 64;
/** Result of sanitization operation */
export interface SanitizeResult {
    /** The sanitized tool name */
    sanitized: string;
    /** Whether the name was changed */
    changed: boolean;
}
/**
 * Check if a tool name is valid for Gemini API.
 *
 * Requirements:
 * - Length <= 64 characters
 * - Starts with letter or underscore
 * - Contains only valid characters: a-z A-Z 0-9 _ . : -
 */
export declare function isValidToolName(name: string): boolean;
/**
 * Remove consecutive duplicate segments separated by '__'.
 *
 * Examples:
 * - 'gitmcp__foo__foo' → 'gitmcp__foo'
 * - 'a__b__c__b__c' → 'a__b__c'
 * - 'no_dupes' → 'no_dupes'
 */
export declare function removeDuplicateSegments(name: string): string;
/**
 * Smart truncate a name to fit within maxLen.
 * Preserves start of name and appends hash suffix for uniqueness.
 *
 * Format: <prefix>_<6-char-hash>
 *
 * @param name The name to truncate
 * @param maxLen Maximum allowed length (default: 64)
 */
export declare function smartTruncate(name: string, maxLen?: number): string;
/**
 * Sanitize a tool name to comply with Gemini API constraints.
 *
 * Process:
 * 1. Remove duplicate segments (always, as duplicates are likely unintentional)
 * 2. Truncate with hash if >64 chars
 * 3. Force valid characters if still invalid
 * 4. Truncate again if forced-valid name exceeds limit
 *
 * @param name The original tool name
 * @returns Sanitization result with sanitized name and changed flag
 */
export declare function sanitizeToolName(name: string): SanitizeResult;
//# sourceMappingURL=tool-name-sanitizer.d.ts.map