import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { type StructuredPatch as ParsedFile } from 'diff'; import { type DiffCacheSlot } from './gemini/cache.js'; import { createErrorToolResponse } from './tool-response.js'; export type { ParsedFile }; export declare function getMaxDiffChars(): number; export declare function resetMaxDiffCharsCacheForTesting(): void; export declare function exceedsDiffBudget(diff: string): boolean; export declare function getDiffBudgetError(diffLength: number, maxChars?: number): string; export declare function validateDiffBudget(diff: string): ReturnType | undefined; export declare const NOISY_EXCLUDE_PATHSPECS: readonly [":(exclude)package-lock.json", ":(exclude)yarn.lock", ":(exclude)pnpm-lock.yaml", ":(exclude)bun.lockb", ":(exclude)*.lock", ":(exclude)dist/", ":(exclude)build/", ":(exclude)out/", ":(exclude).next/", ":(exclude)coverage/", ":(exclude)*.min.js", ":(exclude)*.min.css", ":(exclude)*.map"]; export declare function cleanDiff(raw: string): string; export declare function isEmptyDiff(diff: string): boolean; export declare const EMPTY_DIFF_STATS: Readonly; export interface DiffStats { files: number; added: number; deleted: number; } export declare function parseDiffFiles(diff: string): ParsedFile[]; export declare function computeDiffStatsAndSummaryFromFiles(files: readonly ParsedFile[]): Readonly<{ stats: DiffStats; summary: string; }>; export declare function computeDiffStatsAndPathsFromFiles(files: readonly ParsedFile[]): Readonly<{ stats: DiffStats; paths: string[]; }>; export declare function extractChangedPaths(diff: string): string[]; export declare function computeDiffStatsFromFiles(files: readonly ParsedFile[]): Readonly; export declare function computeDiffStats(diff: string): Readonly; export declare function formatFileSummary(files: ParsedFile[]): string; export declare const DIFF_RESOURCE_URI = "internal://diff/current"; export declare const diffStaleWarningMs: import("./config.js").CachedEnvInt; export interface DiffSlot { diff: string; diffHash: string; parsedFiles: readonly ParsedFile[]; stats: DiffStats; generatedAt: string; /** Numeric epoch ms cached at creation to avoid repeated Date parsing. */ generatedAtMs: number; mode: string; /** Auto-inferred repository identifier (owner/repo) from git remote. */ repository: string; } export declare function computeDiffHash(diff: string): string; /** Binds diff resource notifications to the currently active server instance. */ export declare function initDiffStore(server: McpServer): void; export declare function disposeDiffStore(): void; export declare function storeDiff(data: DiffSlot, key?: string): void; export declare function getDiff(key?: string): DiffSlot | undefined; export declare function hasDiff(key?: string): boolean; /** Returns the current Gemini context cache slot for the diff, if available and model-compatible. */ export declare function getDiffCacheSlot(model?: string): DiffCacheSlot | undefined; /** Test-only: directly set or clear the diff slot without emitting resource-updated. */ export declare function setDiffForTesting(data: DiffSlot | undefined, key?: string): void; export declare function createNoDiffError(): ReturnType;