UNPKG

ultimate-mcp-server

Version:

The definitive all-in-one Model Context Protocol server for AI-assisted coding across 30+ platforms

151 lines 3.96 kB
/** * Platform Utilities * * Cross-platform compatibility helpers for Ultimate MCP */ export declare enum Platform { WINDOWS = "win32", MAC = "darwin", LINUX = "linux", UNKNOWN = "unknown" } /** * Get current platform */ export declare function getPlatform(): Platform; /** * Check if running on Windows */ export declare function isWindows(): boolean; /** * Check if running on Mac */ export declare function isMac(): boolean; /** * Check if running on Linux */ export declare function isLinux(): boolean; /** * Get platform-specific path separator */ export declare function getPathSeparator(): string; /** * Join paths in a cross-platform way */ export declare function joinPath(...paths: string[]): string; /** * Normalize path for current platform */ export declare function normalizePath(inputPath: string): string; /** * Convert to platform-specific absolute path */ export declare function toAbsolutePath(inputPath: string): string; /** * Get platform-specific temp directory */ export declare function getTempDir(): string; /** * Get platform-specific home directory */ export declare function getHomeDir(): string; /** * Get platform-specific config directory */ export declare function getConfigDir(appName?: string): string; /** * Get platform-specific data directory */ export declare function getDataDir(appName?: string): string; /** * Get platform-specific cache directory */ export declare function getCacheDir(appName?: string): string; /** * Execute command in a cross-platform way */ export declare function executeCommand(command: string, args?: string[], options?: { cwd?: string; env?: NodeJS.ProcessEnv; }): Promise<{ stdout: string; stderr: string; }>; /** * Spawn process in a cross-platform way */ export declare function spawnProcess(command: string, args?: string[], options?: { cwd?: string; env?: NodeJS.ProcessEnv; shell?: boolean; }): import("child_process").ChildProcessWithoutNullStreams; /** * Get platform-specific executable extension */ export declare function getExecutableExtension(): string; /** * Get platform-specific script extension */ export declare function getScriptExtension(): string; /** * Convert line endings for current platform */ export declare function normalizeLineEndings(text: string): string; /** * Get platform-specific environment variable */ export declare function getEnvVar(name: string, fallback?: string): string | undefined; /** * Check if a file is executable */ export declare function isExecutable(filePath: string): Promise<boolean>; /** * Make a file executable (Unix-like systems only) */ export declare function makeExecutable(filePath: string): Promise<void>; /** * Get platform-specific null device */ export declare function getNullDevice(): string; /** * Get platform info */ export declare function getPlatformInfo(): { platform: Platform; platformName: NodeJS.Platform; arch: string; release: string; hostname: string; cpus: number; totalMemory: number; freeMemory: number; homeDir: string; tempDir: string; pathSeparator: "\\" | "/"; eol: string; }; /** * Resolve module path in a cross-platform way */ export declare function resolveModulePath(moduleName: string, basePath?: string): string; /** * Get platform-specific browser command */ export declare function getBrowserCommand(): string; /** * Open URL in default browser */ export declare function openInBrowser(url: string): Promise<void>; /** * Ensure directory exists */ export declare function ensureDir(dirPath: string): Promise<void>; /** * Safe file write with atomic operation */ export declare function safeWriteFile(filePath: string, data: string | Buffer, encoding?: BufferEncoding): Promise<void>; /** * Check if running in a container (Docker, etc.) */ export declare function isContainer(): Promise<boolean>; //# sourceMappingURL=platform-utils.d.ts.map