import { type DetectAppResult } from './binDetect'; export interface GimpInstallDeps { platform: NodeJS.Platform; env: NodeJS.ProcessEnv; homedir: () => string; fileExists: (p: string) => boolean; listDir: (p: string) => string[]; mkdirp: (p: string) => void; writeFile: (p: string, data: string) => void; chmod: (p: string, mode: number) => void; copyFile: (src: string, dst: string) => void; /** Read an existing file (for idempotent-skip content comparison). '' if unreadable. */ readFile: (p: string) => string; /** * The GIMP-side plug-in (server) source. Defaults to the EMBEDDED string * (GIMP_PLUGIN_SOURCE) so it works when esbuild-bundled into the VS Code * extension where media/gimp/gimp_mcp_server.py is NOT on disk at runtime. */ readPluginSource: () => string; /** * The MCP client source. Defaults to the EMBEDDED string (GIMP_CLIENT_SOURCE), * same bundle-safety rationale as readPluginSource. */ readClientSource: () => string; /** GIMP detection (to gate on major < 3). Defaults to detectApp('gimp'). */ detectGimp: () => DetectAppResult; } export interface GimpInstallResult { installed: boolean; /** Primary GIMP-side plug-in .py path written (the real %APPDATA%/config one). */ serverPath: string | null; /** Primary MCP client .py path written (/mcp/gimp_mcp_client.py). */ clientPath: string | null; /** All plug-in (server) .py paths written (incl. the win32 Store fallback). */ paths: string[]; /** All MCP client .py paths written. */ clientPaths: string[]; /** The GIMP minor-version dir chosen (e.g. "3.2"), or null when not installed. */ version: string | null; warnings: string[]; } export interface GimpInstallOpts { /** * Explicit versioned GIMP config dir to target (e.g. `~/.config/GIMP/3.2`), * bypassing the auto-resolver. Same semantics as GIMP3_DIRECTORY. */ targetDir?: string; } /** Absolute path to the vendored plug-in (server) shipped in the tarball. */ export declare function vendoredPluginSourcePath(): string; /** Absolute path to the vendored MCP client shipped in the tarball. */ export declare function vendoredClientSourcePath(): string; /** The MCP client .py path for a versioned config dir (sibling `mcp/` folder). */ export declare function clientPathFor(configDir: string): string; /** Extract the GIMP MAJOR version from a launcher path (e.g. gimp-2.10 → 2). */ export declare function gimpMajorFromPath(p: string | null): number | null; /** * Install BOTH the GIMP-side plug-in (server) and the MCP client. Resolves the * target config dir(s) per-OS and writes the vendored files. Does NOT install * when a clearly < 3 GIMP is the only one detected. */ export declare function installGimpPlugin(opts?: GimpInstallOpts, deps?: Partial): GimpInstallResult; /** * Sync-path variant: install ONLY when GIMP 3.x is actually DETECTED. Unlike * installGimpPlugin (which will create a 3.0 config dir even with no GIMP present * — appropriate for the explicit `mcp detect --enable gimp` / `gimp-install-plugin` * flows), this refuses to touch the filesystem when GIMP is absent or is clearly * < 3, so a routine ConfigManager.syncProjectMcpServers on a box without GIMP * never spuriously creates a config dir. Returns a skip result (installed:false + * warning) instead of throwing so callers can swallow it. */ export declare function installGimpPluginIfDetected(opts?: GimpInstallOpts, deps?: Partial): GimpInstallResult; /** * Resolve the PRIMARY MCP client path for the current machine WITHOUT writing * anything — gated on GIMP 3.x being detected (same gate as * installGimpPluginIfDetected). Returns null when GIMP is absent / clearly < 3, * so callers (the migration, catalog display) can decide not to bake a path in. * This is the exact path installGimpPlugin() would write the client to. */ export declare function resolveGimpClientPath(opts?: GimpInstallOpts, deps?: Partial): string | null;