interface RegistryRepoMeta {
    name: string;
    root: string;
    symbol_count: number;
    file_count: number;
}
/** Read registry synchronously, cached by mtime to avoid disk hits in the hot path. */
export declare function loadRegistrySync(registryPath?: string): RegistryRepoMeta[];
/** True iff `descendant` is `ancestor` or sits underneath it on a path-segment boundary. */
export declare function isAncestorOrEqual(ancestor: string, descendant: string): boolean;
/**
 * Resolve the repo name for a CWD by consulting the registry.
 *
 * Strategy:
 *  1. Drop chat-history indexes (`~/.claude/projects/...`) — they shadow real
 *     repos when the AI session's CWD matches them as a sibling/ancestor.
 *  2. Drop empty entries (symbol_count=0) — they're stub registrations from
 *     `index_folder` calls that found nothing or got auto-created on cd.
 *  3. From remaining repos whose `root` is an ancestor of `cwd`, pick the
 *     longest match. This handles monorepo subdirs and worktrees correctly:
 *     cwd=/repo/apps/api with root=/repo registered → resolves to /repo's name.
 *  4. If nothing matches, fall back to `local/<basename(cwd)>` so the tool
 *     surfaces a clear NOT INDEXED error instead of silently using a stale value.
 */
export declare function resolveRepoFromCwd(cwd: string, registryPath?: string): string;
/** Test-only: drop the registry cache. */
export declare function _resetRegistryCacheForTests(): void;
export interface ToolResponse {
    [key: string]: unknown;
    content: Array<{
        type: "text";
        text: string;
    }>;
    isError?: boolean;
}
interface ShorteningEntry {
    compact?: (data: unknown) => string;
    counts?: (data: unknown) => string;
}
export declare function registerShortener(toolName: string, entry: ShorteningEntry): void;
export declare function resetShorteningRegistry(): void;
/** Track sequential calls + session-level state. Exported for testing. */
export declare function trackSequentialCalls(toolName: string): void;
export declare function errorResult(message: string): ToolResponse;
/**
 * Build optimization hints based on response data + call patterns.
 * Returns compact hint codes (decoded in CLAUDE.md).
 */
export declare function buildResponseHint(toolName: string, args: Record<string, unknown>, data: unknown): string | null;
export declare function wrapTool<T>(toolName: string, args: Record<string, unknown>, fn: () => Promise<T>): () => Promise<ToolResponse>;
/**
 * Reset all session-level tracking state. Exported for testing only.
 */
export declare function resetSessionState(): void;
export {};
//# sourceMappingURL=server-helpers.d.ts.map